This project has moved and is read-only. For the latest updates, please go here.

When I close modal window, also the owner closes

Nov 11, 2010 at 10:37 AM


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

Nov 13, 2010 at 2:25 PM


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.