Beispiel #1
0
 private void CloseWpfWindow()
 {
   if (_wpfWindow != null)
   {
     // Close WPF window.
     _wpfWindow.Closing -= OnWindowClosing;  // Remove Closing event handler. (Otherwise, the event would exit the game.)
     _wpfWindow.Close();
     _wpfWindow = null;
   }
 }
Beispiel #2
0
 private void CloseWpfWindow()
 {
     if (_wpfWindow != null)
     {
         // Close WPF window. This must be executed on the WPF thread!
         WpfEnvironment.Dispatcher.Invoke((Action)(() =>
         {
             _wpfWindow.Closing -= OnWindowClosing; // Remove Closing event handler. (Otherwise, the event would exit the game.)
             _wpfWindow.Close();
             _wpfWindow = null;
         }));
     }
 }