@@ -16,6 +16,7 @@ public partial class MainWindow : Window
1616 private readonly IInputService inputService ;
1717 private readonly InteractionRequest < NotificationWithAudioService > managementWindowRequest ;
1818 private readonly ICommand managementWindowRequestCommand ;
19+ private readonly ICommand quitCommand ;
1920
2021 public MainWindow ( IAudioService audioService ,
2122 IInputService inputService )
@@ -27,6 +28,7 @@ public MainWindow(IAudioService audioService,
2728
2829 managementWindowRequest = new InteractionRequest < NotificationWithAudioService > ( ) ;
2930 managementWindowRequestCommand = new DelegateCommand ( RequestManagementWindow ) ;
31+ quitCommand = new DelegateCommand ( Quit ) ;
3032
3133 //Setup key binding (Alt-M and Shift-Alt-M) to open settings
3234 InputBindings . Add ( new KeyBinding
@@ -45,6 +47,7 @@ public MainWindow(IAudioService audioService,
4547
4648 public InteractionRequest < NotificationWithAudioService > ManagementWindowRequest { get { return managementWindowRequest ; } }
4749 public ICommand ManagementWindowRequestCommand { get { return managementWindowRequestCommand ; } }
50+ public ICommand QuitCommand { get { return quitCommand ; } }
4851
4952 private void RequestManagementWindow ( )
5053 {
@@ -56,5 +59,13 @@ private void RequestManagementWindow()
5659 } ,
5760 _ => inputService . RequestResume ( ) ) ;
5861 }
62+
63+ private void Quit ( )
64+ {
65+ if ( MessageBox . Show ( Properties . Resources . QUIT_MESSAGE , Properties . Resources . QUIT , MessageBoxButton . YesNo ) == MessageBoxResult . Yes )
66+ {
67+ Application . Current . Shutdown ( ) ;
68+ }
69+ }
5970 }
6071}
0 commit comments