I have three windows. FirstWindow
, SecondWindow
and ThirdWindow
. FirstWindow
has button and click on this button opens the SecondWindow
. Analogously, SecondWindow
has button and click on this button opens the ThirdWindow
. Owner
property of the SecondWindow
is set as FirstWindow
and Owner
property of the ThirdWindow
is set as SecondWindow
. The scenario discribing problem:
Open all windows in a row. It will be looked like this:
Then minimize all windows by click on corresponding icon at top right corner of ThirdWindow
.
If you will try to maximize all windows by clicking on FirstLevelWindow
or ThirdLevelWinow
in taskbar - all will be ok, three windows will be maximized. But if you will click on SecondWindow
you will see this:
How can I fix it, or it is just WPF
bug? I can give archived expample project if it helps.
UPDATE
Minimize window - click "_" icon, left icon in iconbar of the window. All windows are modal, i.e it opens with ShowDialog()
method, not with Show()
method. So if you minimize third window - all the windows will be minimized.
Here the code if you don't want download project by link:
FirstWindow
XAML:
<Button Click="OpenChildWindow"
Content="ChildWindow"/>
FirstWindow
.cs:
private void OpenChildWindow(Object sender, RoutedEventArgs e)
{
var window = new SecondLevelWindow();
window.Owner = this;
window.ShowDialog();
}
SecondWindow
XAML:
<Button Click="OpenChildWindow"
Content="ChildWindow"/>
SecondWindow
.cs:
private void OpenChildWindow(Object sender, RoutedEventArgs e)
{
var window = new ThirdLevelWindow();
window.Owner = this;
window.ShowDialog();
}
ThirdWindow
is empty window without any content.
Here link to example project
I've just found, that bug is not reproduced if property ResizeMode
of ThirdWindow
is set to "NoResize". Mb it will be usefull information.