Exemple #1
0
 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;
		}
Exemple #3
0
 private Compile()
 {
     InputGestures.Add(new KeyGesture(Key.F5, ModifierKeys.None));
 }
Exemple #4
0
 private AddNewFile()
 {
     InputGestures.Add(new KeyGesture(Key.O, ModifierKeys.Control));
 }
 public Command(string text, string name, params InputGesture[] keys) : base(text, name, typeof(Window))
 {
     InputGestures.AddRange(keys);
 }
 public Command(string text, string name, BitmapImage icon, params InputGesture[] keys) : base(text, name, typeof(Window))
 {
     Icon = icon;
     InputGestures.AddRange(keys);
 }