Hi,
We have WPF application which uses xamDialogWindow as a base class for MDI-like interface. I would like to prompt user on exit when some changes made on a screen are not saved. I understand I can't do it on Unloaded event because I cannot cancel the event and return back to the dialog. I tried to use LostFocus but it also doesn't work i.e. works for any LostFocus event on dialog window... Is it possible to catch the event before Unloaded and cancel it if it's necessary ?
Thanks,
Ed
Hello Ed,
Thank you for your post. I have been looking into it and I can suggest you handle the XamDialogWindow’s WindowStateChanging event and add the following code in its handler:
if (e.NewWindowState == Infragistics.Controls.Interactions.WindowState.Hidden) { //Here you can decide whether to cancel or not the closing of the window. e.Cancel = true; }
In order to achieve the functionality you want. Please let me now if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Stefan,
Yes, it works. Thank you very much!
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.