Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1690
Prompt before xamDialogWindow unloaded
posted

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

Parents
  • 138253
    Verified Answer
    Offline posted

    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.

Reply Children
No Data