Cancelling Window close in WPF
Thursday, November 27, 2008 12:25Posted in category English, Windows Presentation Foundation
No Comments
In this post we will avoid a window to be closed.
Forms in .NET 2.0 have the Closing event and this event has the e parameter of type ClosingEventArgs.
ClosingEventArgs has the Cancel property that if set to True will cancel the close procedure.
Visual Studio 2008 SP1 when used with a WPF project will generate an e parameter of type EventArgs. Just changing the type to ClosingEventArgs will do the job.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

