This project has moved. For the latest updates, please go here.
1
Vote

AvalonDock

description

Avalondock 3 autohide button always auto hides to the right. Can anyone help to resolve the issue?

file attachments

comments

BoucherS wrote Mar 7 at 6:08 PM

Hi,

Can you submit a sample of this please.
Give exact steps to reproduce and AvalonDock version (3.0, 3.1, 3.2....)
Thanks.

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF

maratmusaev wrote Mar 9 at 2:54 PM

I will try to create a sample and submit it when I can. However, I think it can be reproduced easily.
1) Create an app using AvalonDock.
2) Run the app and arrange the windows/usercontrols contained in AvalonDock windows.
3) Close the app and persists the windows settings into xml file.
4) Restart the app and click auto hide(AvalonDocks autohide button) on any of the windows - AvalonDock docks window to the right.

wrote Mar 9 at 9:19 PM

maratmusaev wrote Mar 9 at 9:19 PM

Here is the sample app attached. I have three xml files that contain layout of the windows. They are called LayoutXml1, LayoutXml2 and LayoutXml3. Using combo box you can load those different layouts.

The layout that we want is LayoutXml2.xml file which is "No Document" option in the combo box. LayoutXml2 option does not have LayoutDocumentPaneGroup, which causes this issue of docking everything to the right.

LayoutXml1 and LayoutXml3 work correctly when clicking auto hide - docks in a right position not everything to the right of main window. However, LayoutXml1 has a big gap between Window2/Window3 and Window4. If I could get right this gap than I would use this option. This gap is due to the presence LayoutDocumentPaneGroup. LayoutXml3 has tabbed document which is not what we want.

Let me if this is clear.

BoucherS wrote Mar 13 at 3:55 PM

Hi,

Can you go in file :
-Xceed.Wpf.AvalonDock/Layout/Extensions.cs,
and replace the "GetSide" method with :
 public static AnchorSide GetSide( this ILayoutElement element )
    {
      var parentContainer = element.Parent as ILayoutOrientableGroup;
      if( parentContainer != null )
      {
        var layoutPanel = parentContainer as LayoutPanel;
        if( layoutPanel == null )
        {
          layoutPanel = parentContainer.FindParent<LayoutPanel>();
        }

        if( (layoutPanel != null) && ( layoutPanel.Children.Count > 0 ) )
        {
          if( layoutPanel.Orientation == System.Windows.Controls.Orientation.Horizontal )
            return layoutPanel.Children[ 0 ].Descendents().Contains( element ) ? AnchorSide.Left : AnchorSide.Right;
          return layoutPanel.Children[ 0 ].Descendents().Contains( element ) ? AnchorSide.Top : AnchorSide.Bottom;
        }
      }

      Debug.Fail( "Unable to find the side for an element, possible layout problem!" );
      return AnchorSide.Right;
    }
Tell me if it helps.
Thanks
――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF

maratmusaev wrote Mar 13 at 5:19 PM

Seems solves the issue. Thank you.

I have a question though. Why when clicked on auto hide button the whole group gets auto hidden not just individual window? Is there any way to make just the target window to be auto hidden not the whole group?

BoucherS wrote Mar 13 at 6:21 PM

Hi,

Can you be more precise, based on your sample ?
If you have a LayoutAnchorablePaneGroup with some LayoutAnchorables, auto-hidding the group will auto-hide all of its children.

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF

maratmusaev wrote Mar 13 at 10:37 PM

If there are two or three LayoutAnchorables is in LayoutAnchorablePaneGroup is the way just to auto hide a single window instead of the whole group? It would be nice auto hide just a single window and have the flexibility to keep others not being auto hidden.

Thank you,
Marat

BoucherS wrote Mar 14 at 2:15 PM

You are doing right in your samples. Just define 1 LayoutAnchorable per LayoutAnchorablePaneGroup will let you auto-hide only 1 "Window".

When the LayoutAnchorables are grouped, auto-hiding the group should auto-hide all of its LayoutAnchorables. You can not, at the moment ,auto-hide only 1 LayoutAnchorable from a LayoutAnchorablePanegroup.

Issue https://wpftoolkit.codeplex.com/workitem/22503 has been created to address this.

BoucherS wrote Mar 14 at 2:15 PM

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF