As part of a Presenter termination i would like to remove all the commands related to the presenter. AFAIK each command include the following Event Handler
When I try to remove the commands from my Presenter’s Work Item I try the following code:
commandPair.Value.ExecuteAction -=new EventHandler(command_ExecuteAction);
However I get the following error
Removing Commands from WorkItem is not permitted. An attempt was made to remove the command f7f6b5c1-dd39-43ca-8393-38b609c1d031_Search.
Parameter name: item
I have 2 questions:
Assuming that my commands are not related to any other Handlers, Invocation etc. what is the reason I cannot remove these commands or why don’t I have permission to?
If the commands DO related to something how can I find it? how can I get the real reason why I don’t have permission?