Browse Source

Don't try to shutdown if e.Cancel already set.

This allows users to add their own `ShutdownRequested` handlers which can override the lifetime's handler.
pull/6174/head
Steven Kirk 5 years ago
parent
commit
39394bceb6
  1. 3
      src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs

3
src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs

@ -132,6 +132,9 @@ namespace Avalonia.Controls.ApplicationLifetimes
private void ShutdownRequested(object sender, CancelEventArgs e) private void ShutdownRequested(object sender, CancelEventArgs e)
{ {
if (e.Cancel)
return;
// When an OS shutdown request is received, try to close all non-owned windows. Windows can cancel // When an OS shutdown request is received, try to close all non-owned windows. Windows can cancel
// shutdown by setting e.Cancel = true in the Closing event. Owned windows will be shutdown by their // shutdown by setting e.Cancel = true in the Closing event. Owned windows will be shutdown by their
// owners. // owners.

Loading…
Cancel
Save