public void Close(bool minimize = true) { if (minimize) { window.WindowState = WindowState.Minimized; window.Hide(); } else { if (onQuit != null) { onQuit.Invoke(); } TasksUpdateTimer.StopTimer(); Environment.Exit(0); } }
public DashboardWindowViewModel(Window window, Action onQuit) { this.window = window; this.onQuit = onQuit; InitializeViewSources(); //Default Values SelectedListOrder = Remaining; SelectedQuickListType = ComingDue; Hotkey.SetDefaultShowWindowHotkey(ShowWindow); ReloadLists(); UpdateStats(); quickListSource = new CollectionViewSource(); quickListSource.Source = quickList; TasksUpdateTimer.OnTasksUpdated += TasksUpdateTimer_OnTasksUpdated; TasksUpdateTimer.UpdateTasks(); TasksUpdateTimer.StartTimer(); }