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