public Command(CommandDefinitionBase commandDefinition) { CommandDefinition = commandDefinition; Text = commandDefinition.Text; ToolTip = commandDefinition.ToolTip; //IconSource = commandDefinition.IconSource; }
public Command GetCommand(CommandDefinitionBase commandDefinition) { Command command; if (!_commands.TryGetValue(commandDefinition, out command)) { command = _commands[commandDefinition] = new Command(commandDefinition); } return(command); }
public KeyGesture GetPrimaryKeyGesture(CommandDefinitionBase commandDefinition) { var keyboardShortcut = _keyboardShortcuts.FirstOrDefault(x => x.CommandDefinition == commandDefinition); return(keyboardShortcut?.KeyGesture); }