IsCancelable Property
Collapse the table of content
Expand the table of content

ClosingEventArgs.IsCancelable Property


Gets a value that indicates whether you can cancel the Window.Closing event.

Namespace:  System.ComponentModel
Assembly:  System.Windows (in System.Windows.dll)

public bool IsCancelable { get; }

Property Value

Type: System.Boolean
true if you can cancel the event; otherwise, false.

Use the ClosingEventArgs.IsCancelable property to determine whether you can cancel the Window.Closing event. You can cancel the event and prevent the window from closing by setting the Cancel property to true. However, this works only if the event occurred because the Close method was called, or the user clicked the Close button or pressed ALT+F4. You cannot cancel the event if the window is closing for some other reason, such as system shutdown.


Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

© 2016 Microsoft