public MainWindowCommand(string text, string name, InputGesture gesture = null, bool noImage = false) : base(text, name, typeof(MainWindow)) { if (gesture != null) { InputGestures.Add(gesture); } if (!noImage && !string.IsNullOrEmpty(name)) { string packUri = string.Format("pack://application:,,,/CommandIcons/{0}.png", name); ImageSource = new ImageSourceConverter().ConvertFromString(packUri) as ImageSource; } }
public SimpleCommand(string text, ModifierKeys modifiers, Key key) { InputGestures.Add(new KeyGesture(key, modifiers)); Text = text; }
private Compile() { InputGestures.Add(new KeyGesture(Key.F5, ModifierKeys.None)); }
private AddNewFile() { InputGestures.Add(new KeyGesture(Key.O, ModifierKeys.Control)); }