Catel.MVVM.CommandManager.GetCommand C# (CSharp) Метод

GetCommand() публичный Метод

Gets the command created with the command name.
The is null or whitespace.
public GetCommand ( string commandName ) : ICommand
commandName string Name of the command.
Результат ICommand
        public ICommand GetCommand(string commandName)
        {
            Argument.IsNotNullOrWhitespace("commandName", commandName);

            lock (_lockObject)
            {
                if (_commands.ContainsKey(commandName))
                {
                    return _commands[commandName];
                }

                return null;
            }
        }

Usage Example

Пример #1
0
            public void ReturnsCommandForCreatedCommand()
            {
                var commandManager = new CommandManager();

                commandManager.CreateCommand("MyCommand");

                Assert.IsNotNull(commandManager.GetCommand("MyCommand"));
            }
All Usage Examples Of Catel.MVVM.CommandManager::GetCommand