private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (DataContext is MainWindowViewModel mwvm) { if (!mwvm.CloseAllTabs()) { e.Cancel = true; } } PipeManager.StopServer(); }
private async void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (!should_really_close) { e.Cancel = true; } if (DataContext is MainWindowViewModel mwvm) { if (await mwvm.CloseAllTabs()) { mwvm.SaveSettings(); if (!should_really_close) { should_really_close = true; this.Close(); } } } if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { PipeManager.StopServer(); } }