Some defects in new version

Apr 7, 2009 at 8:14 AM

Hi, Ado!
(Sorry for my poor English).
1. I seem to find a bug. DockingManager.cs in Anchor(DockablePane paneToAnchor, DocumentPane relativePane, AnchorStyle anchor):
            if (anchor == AnchorStyle.Left ||
                anchor == AnchorStyle.Right)
            {
                double w = Math.Min(
                    ActualWidth / 2.0,
                    ResizingPanel.GetEffectiveSize(paneToAnchor).Width);
                ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(w, GridUnitType.Pixel));
                ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(1.0, GridUnitType.Star));
            }
            else
            {
                double h = Math.Min(
                    ActualHeight / 2.0,
                    ResizingPanel.GetEffectiveSize(paneToAnchor).Height);
                ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(1.0, GridUnitType.Star));
                ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(h, GridUnitType.Pixel));
            }
             
after correcting:
            if (anchor == AnchorStyle.Left ||
                anchor == AnchorStyle.Right)
            {
                double w = Math.Min(
                    ResizingPanel.GetEffectiveSize(relativePane).Width / 2.0,
                    ResizingPanel.GetEffectiveSize(paneToAnchor).Width);
                ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(w, GridUnitType.Pixel));
                ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(1.0, GridUnitType.Star));
            }
            else
            {
                double h = Math.Min(
                    ResizingPanel.GetEffectiveSize(relativePane).Height / 2.0,
                    ResizingPanel.GetEffectiveSize(paneToAnchor).Height);
                ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(1.0, GridUnitType.Star));
                ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(h, GridUnitType.Pixel));
            }

2. Try to run your test project AvalonDockTest. I drag “Properties” pane and drop it into “Object explorer” pane to anchor (Right). Why “Object explorer” pane is larger in 2 times than “Properties” pane. I seem that it’s not correctly. “Properties” pane should have size such as we seen at hit on right-anchor button.

3. Probably, it is necessary to have a possibility to use or not proportions for resizing of concrete content. It’s very important at run-time.

Thanks.
Eugene.

Apr 8, 2009 at 3:15 PM
Hi Eugene,

1. Yes it's a bug now corrected, thanks.
2 and 3. Starting from version 1.2 ResizeWidth/Height propertyies are of type GridLength. This means that one can specify proportional width in the form of ResizeWidth="2*" like in Grid Columns/Rows sizes.
I had no time to write a detailed help for this new feature but is very important, so I suggest you to refer to my blog entry:
http://www.youdev.net/post/2009/03/19/WPF-SplitContainer-Part-2.aspx
Said that when you redock Properties content into ObjectExplorer pane, the second doubles its size because its resizewidth is not set, ie is set to default "*".

Ado
Apr 10, 2009 at 6:25 AM

Hi Ado,

2. OK, may be it's possible in your concept, that  when you redock Properties content into ObjectExplorer pane, the second doubles its size because its resizewidth is not set, ie is set to default "*". But, why it's not true, if  I drag “Server Explorer” pane and drop it into “Object explorer” pane to anchor (Right)?
3. --
4. By the way, next bugs:
4a. Run AvalonDockTest. Drag “Properties” pane and drop it into “Object explorer” pane to anchor (Right). Set “Properties” pane in AutoHide and return Docked state again. Do it several times. “Properties” pane becomes smaller in every cycle.
I cope this problem: DockingManager.cs in ToggleAutoHide (comment one line):
                if (parentPanel != null && parentPanel.Children.Count >= 3)
                {
                    // parentPanel.AdjustPanelSizes();
                }
4b. Run AvalonDockTest. Drag “Server Explorer” pane to right-bottom corner of screen. “Server Explorer” pane loses mouse cursor and events.
4c. Run AvalonDockTest. It's AvalonDockTest.Layout.xml:
<DockingManager>
    <ResizingPanel ResizeWidth="*" ResizeHeight="*" Orientation="Horizontal">
        <ResizingPanel ResizeWidth="*" ResizeHeight="*" Orientation="Vertical">
            <DocumentPanePlaceHolder />
            <DockablePane ResizeWidth="*" ResizeHeight="*" Anchor="Bottom">
                <DockableContent Name="_objectExplorerHost" AutoHide="false" EffectiveSize="0,0" />
            </DockablePane>
        </ResizingPanel>
        <ResizingPanel ResizeWidth="*" ResizeHeight="*" Orientation="Vertical">
            <DockablePane ResizeWidth="*" ResizeHeight="0.25*" Anchor="Right">
                <DockableContent Name="_eventsLogWindow" AutoHide="false" FloatingWindowSize="394,268.361666666667" EffectiveSize="0,0" />
            </DockablePane>
            <ResizingPanel ResizeWidth="*" ResizeHeight="0.372225938095267*" Orientation="Horizontal">
                <DockablePane ResizeWidth="0.494871794871795*" ResizeHeight="199.782346247619" Anchor="Right">
                    <DockableContent Name="_errorList" AutoHide="false" EffectiveSize="0,0">
                        <Column Header="First Name" Width="100" />
                        <Column Header="Last Name" Width="100" />
                        <Column Header="Employee No." Width="100" />
                    </DockableContent>
                </DockablePane>
                <DockablePane ResizeWidth="0.505128205128205*" ResizeHeight="199.782346247619" Anchor="Right">
                    <DockableContent Name="_propertiesWindow" AutoHide="false" FloatingWindowSize="394,178.907777777778" EffectiveSize="0,0" />
                </DockablePane>
            </ResizingPanel>
            <DockablePane ResizeWidth="*" ResizeHeight="0.377774061904733*" Anchor="Right">
                <DockableContent Name="_explorerWindow" AutoHide="false" FloatingWindowSize="394,544.723333333333" EffectiveSize="0,0" />
            </DockablePane>
        </ResizingPanel>
    </ResizingPanel>
    <Hidden />
    <Windows />
</DockingManager>
Restore from this XML and set “Properties” pane as AutoHide. "ErrorList" pane has fixed width. Why?
4d. I use Aero theme in your AvalonDockTest project:
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <!-- Set Aero theme (for WPF) -->
            <!--ResourceDictionary Source="/PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component/themes/aero.normalcolor.xaml" /-->

            <!-- Generic AvalonDock colors -->
            <ResourceDictionary Source="/AvalonDock;component/themes/aero.normalcolor.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>
FloatingWindow doesn't show its content.

Thanks.