No menu = display problem in Maximized position

Apr 29, 2014 at 9:12 AM
Edited Apr 30, 2014 at 9:25 AM
Edit 2 : Resolved by myself after studing WPFMDI, see my second post.

Hello,

If we use WPF MDI without a menu, we have a problem which appears when MdiChild is Maximized.

The MdiChild is larger than expected and in a ScrollViewer (hidden).

Minimized :
Image

Maximized (problem) :
Image

Maximazed after scroll (still a problem) :
Image

I studied the library, but i only found where we added the hidder scrollviwer (WindowStateValueChanged), and to change the height. But it still not found.

Some advices ?

Thanks !


Edit :

My problem is probably coming the possiblity to scroll in a MDIChild maximized. Exemple in the demo (event with a menu).

Before maximizing a mdichild (ok) :
Image

After Maximized (ok) :
Image

After Scrolldown (huge bug =( ) :
Image
Apr 30, 2014 at 9:24 AM
Edited Apr 30, 2014 at 11:24 AM
Both Problems Solved

In MdiContainer (zoom when there is no menu) :
        private void MdiContainer_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            [...]
                mdiChild.Height = InnerHeight; // Before ActualHeight
            [...]
        }
And to be sure InnerHeight will never be negatif :
        internal double InnerHeight
        {
            get { return ((ActualHeight - _topPanel.ActualHeight) > 0) ? (ActualHeight - _topPanel.ActualHeight) : 0; }
        }
In MdiChild (ex : hidden scroll (see screeshots)) :
        private static void WindowStateValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            [...]
                ScrollViewer sv = (ScrollViewer)((Grid)mdiContainer.Content).Children[1];
                sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; 
                sv.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled; 
            [...]
        }
Can someone apply a path ? I'm new on codepley.
Marked as answer by toinou0123 on 4/30/2014 at 2:24 AM