Ejemplo n.º 1
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (DataContext is MainWindowViewModel mwvm)
     {
         if (!mwvm.CloseAllTabs())
         {
             e.Cancel = true;
         }
     }
     PipeManager.StopServer();
 }
Ejemplo n.º 2
0
 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();
     }
 }