public void SaveKeyPress(object sender, KeyEventArgs e) { if (Project != null) { if (e.Key == Key.S && Keyboard.Modifiers.HasFlag(ModifierKeys.Control)) { SaveProject.Execute(null); } } }
public void OpenKeyPress(object sender, KeyEventArgs e) { if (e.Key == Key.O && Keyboard.Modifiers.HasFlag(ModifierKeys.Control)) { if (Project != null) { var dr = MessageBox.Show("Do you want to save current project first?", "", MessageBoxButton.YesNoCancel); if (dr == MessageBoxResult.Cancel) { return; } if (dr == MessageBoxResult.Yes) { SaveProject.Execute(null); } OpenProject.Execute(null); } else { OpenProject.Execute(null); } } }