Catel.MVVM.CommandManager.UpdateInputGesture C# (CSharp) Method

UpdateInputGesture() public method

Updates the input gesture for the specified command.
The is null or whitespace. The specified command is not created using the method.
public UpdateInputGesture ( string commandName, Catel.Windows.Input.InputGesture inputGesture = null ) : void
commandName string Name of the command.
inputGesture Catel.Windows.Input.InputGesture The new input gesture.
return void
        public void UpdateInputGesture(string commandName, InputGesture inputGesture = null)
        {
            Argument.IsNotNullOrWhitespace("commandName", commandName);

            lock (_lockObject)
            {
                Log.Debug("Updating input gesture of command '{0}' to '{1}'", commandName, ObjectToStringHelper.ToString(inputGesture));

                if (!_commands.ContainsKey(commandName))
                {
                    throw Log.ErrorAndCreateException<InvalidOperationException>("Command '{0}' is not yet created using the CreateCommand method", commandName);
                }

                _commandGestures[commandName] = inputGesture;
            }
        }