示例#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;
		}
示例#3
0
 private Compile()
 {
     InputGestures.Add(new KeyGesture(Key.F5, ModifierKeys.None));
 }
示例#4
0
 private AddNewFile()
 {
     InputGestures.Add(new KeyGesture(Key.O, ModifierKeys.Control));
 }