Now disposes tray icon when clicking Quit.

wix
MCARDLE Sean M 2016-12-29 21:45:37 -08:00
parent 4eeaf72d9f
commit b2e7b8ac7c
1 changed files with 3 additions and 2 deletions

View File

@ -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); });
}