public void UnregisterAction(string commandName, Action action)
{
Argument.IsNotNullOrWhitespace("commandName", commandName);
Argument.IsNotNull("action", action);
if (CatelEnvironment.IsInDesignMode)
{
return;
}
lock (_lockObject)
{
Log.Debug("Unregistering action from '{0}'", commandName);
if (!_commands.ContainsKey(commandName))
{
throw Log.ErrorAndCreateException<InvalidOperationException>("Command '{0}' is not yet created using the CreateCommand method", commandName);
}
_commands[commandName].UnregisterAction(action);
InvalidateCommands();
}
}