private void Window_Closing(object sender, CancelEventArgs e) { if (Startup.IsShuttingDown) // show the windows desktop { Shell.ToggleDesktopIcons(true); } else if (altF4Pressed) // Show the Shutdown Confirmation Window { SystemPower.ShowShutdownConfirmation(); e.Cancel = true; } else // Eat it !!! { e.Cancel = true; } }
private void Window_Closing(object sender, CancelEventArgs e) { if (Startup.IsShuttingDown) // show the windows desktop { FullScreenHelper.Instance.FullScreenApps.CollectionChanged -= FullScreenApps_CollectionChanged; Shell.ToggleDesktopIcons(true); } else if (altF4Pressed) // Show the Shutdown Confirmation Window { SystemPower.ShowShutdownConfirmation(); e.Cancel = true; } else // Eat it !!! { e.Cancel = true; } }
private void Window_Closing(object sender, CancelEventArgs e) { if (altF4Pressed) // Show the Shutdown Confirmation Window { SystemPower.ShowShutdownConfirmation(); altF4Pressed = false; e.Cancel = true; } else if (!AllowClose) // Eat it !!! { e.Cancel = true; } if (!e.Cancel) { // unsubscribe from things Settings.Instance.PropertyChanged -= Settings_PropertyChanged; FullScreenHelper.Instance.FullScreenApps.CollectionChanged -= FullScreenApps_CollectionChanged; } }
private void OpenShutDownBox(object sender, RoutedEventArgs e) { SystemPower.ShowShutdownConfirmation(); }