This project is read-only.

how to set the ModernDialog.Owner to current/child window

Feb 28, 2014 at 10:33 PM

I create new windows on button click and capture position, size when window is closed. The problem is that ModernDialog does not show on the current window but instead on the MainWindow and the user does not see the alert since the calling window is on a second or third monitor.
how can I setthe ModernDialog.Owner to display on center on the calling window. I tried :
if (Application.Current.MainWindow.IsActive)
                this.Owner = Application.Current.MainWindow;
but didn't work. Any help is appreciated.

Mar 5, 2014 at 4:55 PM
I modified the constructor to check if window is active and seems to work now.
foreach (Window cWin in Application.Current.Windows)
                if (cWin.IsActive)
                    this.Owner = cWin;
Marked as answer by epasho on 3/5/2014 at 8:55 AM