When I close modal window, also the owner closes

Nov 11, 2010 at 9:37 AM

Hi,

I'm developing a small app like the EmailsAccount sample.

But I'm not using MEF and I'm using, as IoC, Windsor Castle.

All works, but one thing no.

In particular, I have to open and close a Window. When I call ShowDialog, all works correctly, but when I call the Close method, the modal window close BUT also the owner window close.

Please help me!

Thank you very much

Coordinator
Nov 13, 2010 at 1:25 PM

Hi,

Your issue doesn’t sound as it is related to the usage of the IoC Container Windsor Castle.

I believe it might be:

  • Closing of the wrong window instance (the main window or a parent window). It’s important to close only the dialog window.
     
  • The wrong window instance is used as main window by WPF. Check the static “Application.MainWindow” property. This needs to be the ShellWindow and not the dialog window.

jbe