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
35
Cascading modal dialogs possible?
posted

I am developing a WPF application and trying to use XamDialogWindow controls for some modal configuration dialogs. My use case is such that it would be useful for a modal dialog window to launch another modal dialog window (it helps keep the currently accessible interface less cluttered/more focused). We are using Prism and all of our dialogs are confined to a specific region, and all dialog windows exist as singletons that start hidden. When dialogs are not modal, everything works as expected: sub dialogs are launched and the windows coexist happily. However, when the primary and secondary config windows are both launched as modal windows, it generates a StackOverflowException when Show() is called on the second window. I tried this with a bare-bones application and had the same issue.

Ok, I guess this is a valid limitation, so I try a workaround: I set the first window's IsModal value to false prior to calling Show() on the second window. Second window appears (awesome) but the first window disappears (oops). What's more, I can't seem to make the first window reappear while its IsModal property is set to false.

So my questions are as follows:

  • Is it possible to have multiple modal dialogs in the same region visible at the same time (with some kind of z-ordering to determine which is active)? I imagine this working similar to Windows network adapter configuration, where as you drill down into the menus the new dialogs prevent access to higher level dialogs.
  • Is it possible for a XamDialogWindow that has had its IsModal property set to "true" to be used as a visible non-modal window by setting its IsModal property to "false"? It seems there is some irreversible change that is made to the control object that prevents it from being used in a non-modal capacity once it has been set as modal.

If either is possible, that would be sufficient to solve my problem.

Thanks in advance!

  • 35319
    posted

    Hello Marc,

     

    I am just checking if you require any further assistance on the matter.

  • 35319
    posted

    Hi Marc,

     

    Thank you for your post. I have been looking into your question and you cannot have more than one modal window on the same window/page(in your scenario region).

     

    Let me know, if you need any further assistance on this matter.