OT Wpf Question: No CloseReason?

OT Wpf Question: No CloseReason?

Old forum URL: forums.lhotka.net/forums/t/4793.aspx


ajj3085 posted on Friday, May 02, 2008

Hi,

I'm trying to begin a new application in Wpf, and I'm trying to do some similar things to what I have been in Wpf.

For example, in WinForms I have a base BusinessEditForm class.  This overrides OnClosing, which checks the CloseReason.  If the reason is anything other than ApplicationExit, I prompt the user if they would like to save their changes if the BO being edited is dirty.

I just let the window close if ApplicationExit is the reason, however, because I only even call that method if a background thread determines the I have locked out the application and all instances MUST exit immediately.

I would like similar functionality in Wpf, but I can't figure out any way to see if the user chose to close the window, or I've started a shutdown.

Any ideas?

Thanks
Andy

Copyright (c) Marimer LLC