Now disposes tray icon when clicking Quit.
parent
4eeaf72d9f
commit
b2e7b8ac7c
|
@ -37,14 +37,14 @@ namespace WifiSitterGui
|
|||
public TrayIconControl() {
|
||||
InitializeComponent();
|
||||
|
||||
this.Closing += (o, e) => { this.TaskBarIcon.Visibility = Visibility.Hidden; };
|
||||
this.Closing += (o, e) => { TaskBarIcon?.Dispose(); };
|
||||
|
||||
_agentVM = new WifiSitterAgentViewModel(EventAggregator);
|
||||
DataContext = _agentVM;
|
||||
}
|
||||
|
||||
~TrayIconControl() {
|
||||
TaskBarIcon?.Dispose();
|
||||
|
||||
}
|
||||
|
||||
#endregion // constructor
|
||||
|
@ -73,6 +73,7 @@ namespace WifiSitterGui
|
|||
#region eventhandlers
|
||||
|
||||
private void ContextMenu_Quit(object sender, RoutedEventArgs e) {
|
||||
TaskBarIcon?.Dispose();
|
||||
Task.Run(() => { Environment.Exit(0); });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue