/// <summary> /// Clear things. /// </summary> private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (App.Config.General.ExitWhenClosed == null && !ForceExit) { e.Cancel = true; FramePop.Navigate(new ClosingPage(this)); return; } else if (App.Config.General.ExitWhenClosed == false && !ForceExit) { WindowState = WindowState.Minimized; Hide(); e.Cancel = true; return; } ClearHitsoundPlayer(); _cts.Dispose(); WavePlayer.Device?.Dispose(); WavePlayer.MasteringVoice?.Dispose(); LyricWindow.Dispose(); NotifyIcon.Dispose(); _sbWindow?.Close(); if (ConfigWindow == null || ConfigWindow.IsClosed) { return; } if (ConfigWindow.IsInitialized) { ConfigWindow.Close(); } }
/// <summary> /// Popup a dialog for settings. /// </summary> private void BtnSettings_Click(object sender, RoutedEventArgs e) { if (ConfigWindow == null || ConfigWindow.IsClosed) { ConfigWindow = new ConfigWindow(this); ConfigWindow.Show(); } else { if (ConfigWindow.IsInitialized) { ConfigWindow.Focus(); } } }