override protected void OnStop()
{
var timer_wait = new AutoResetEvent(false);
versionCheckTimer.Dispose(timer_wait);
timer_wait.WaitOne();
if (mainWindow != null)
{
mainWindow.Dispatcher.Invoke(new Action(() => {
System.Windows.Application.Current.Shutdown();
}));
}
notifyIconManager.Dispose();
mainThread.Join();
notifyIconThread.Join();
appViewModel.Dispose();
}