Esempio n. 1
0
 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;
     }
 }
Esempio n. 2
0
 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;
     }
 }
Esempio n. 3
0
        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;
            }
        }
Esempio n. 4
0
 private void OpenShutDownBox(object sender, RoutedEventArgs e)
 {
     SystemPower.ShowShutdownConfirmation();
 }