这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 45 additions & 8 deletions source/Components/AvalonDock/Layout/LayoutAnchorable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,20 @@ public void ToggleAutoHide()
case AnchorSide.Right:
if (parentGroup.Root.RootPanel.Orientation == Orientation.Horizontal)
{
previousContainer = new LayoutAnchorablePane { DockMinWidth = AutoHideMinWidth };
previousContainer = new LayoutAnchorablePane
{
DockMinWidth = AutoHideMinWidth,
DockMinHeight = AutoHideMinHeight
};
parentGroup.Root.RootPanel.Children.Add(previousContainer);
}
else
{
previousContainer = new LayoutAnchorablePane();
previousContainer = new LayoutAnchorablePane
{
DockMinHeight = AutoHideMinHeight,
DockMinWidth = AutoHideMinWidth
};
var panel = new LayoutPanel { Orientation = Orientation.Horizontal };
var root = parentGroup.Root as LayoutRoot;
var oldRootPanel = parentGroup.Root.RootPanel;
Expand All @@ -460,12 +468,20 @@ public void ToggleAutoHide()
case AnchorSide.Left:
if (parentGroup.Root.RootPanel.Orientation == Orientation.Horizontal)
{
previousContainer = new LayoutAnchorablePane { DockMinWidth = AutoHideMinWidth };
previousContainer = new LayoutAnchorablePane
{
DockMinWidth = AutoHideMinWidth,
DockMinHeight = AutoHideMinHeight
};
parentGroup.Root.RootPanel.Children.Insert(0, previousContainer);
}
else
{
previousContainer = new LayoutAnchorablePane();
previousContainer = new LayoutAnchorablePane
{
DockMinHeight = AutoHideMinHeight,
DockMinWidth = AutoHideMinWidth
};
var panel = new LayoutPanel { Orientation = Orientation.Horizontal };
var root = parentGroup.Root as LayoutRoot;
var oldRootPanel = parentGroup.Root.RootPanel;
Expand All @@ -478,12 +494,20 @@ public void ToggleAutoHide()
case AnchorSide.Top:
if (parentGroup.Root.RootPanel.Orientation == Orientation.Vertical)
{
previousContainer = new LayoutAnchorablePane { DockMinHeight = AutoHideMinHeight };
previousContainer = new LayoutAnchorablePane
{
DockMinHeight = AutoHideMinHeight,
DockMinWidth = AutoHideMinWidth
};
parentGroup.Root.RootPanel.Children.Insert(0, previousContainer);
}
else
{
previousContainer = new LayoutAnchorablePane();
previousContainer = new LayoutAnchorablePane
{
DockMinWidth = AutoHideMinWidth,
DockMinHeight = AutoHideMinHeight
};
var panel = new LayoutPanel { Orientation = Orientation.Vertical };
var root = parentGroup.Root as LayoutRoot;
var oldRootPanel = parentGroup.Root.RootPanel;
Expand All @@ -498,13 +522,18 @@ public void ToggleAutoHide()
{
previousContainer = new LayoutAnchorablePane
{
DockMinHeight = AutoHideMinHeight
DockMinHeight = AutoHideMinHeight,
DockMinWidth = AutoHideMinWidth
};
parentGroup.Root.RootPanel.Children.Add(previousContainer);
}
else
{
previousContainer = new LayoutAnchorablePane();
previousContainer = new LayoutAnchorablePane
{
DockMinWidth = AutoHideMinWidth,
DockMinHeight = AutoHideMinHeight
};
var panel = new LayoutPanel { Orientation = Orientation.Vertical };
var root = parentGroup.Root as LayoutRoot;
var oldRootPanel = parentGroup.Root.RootPanel;
Expand All @@ -524,9 +553,17 @@ public void ToggleAutoHide()
cnt.PreviousContainer = previousContainer;
}

var selectedIndex = -1;
var selectedItem = parentGroup.Children.FirstOrDefault(x => x.IsActive);
if (selectedItem != null)
selectedIndex = parentGroup.Children.IndexOf(selectedItem);

foreach (var anchorableToToggle in parentGroup.Children.ToArray())
previousContainer.Children.Add(anchorableToToggle);

if (selectedIndex != -1)
previousContainer.SelectedContentIndex = selectedIndex;

parentSide.Children.Remove(parentGroup);

var parent = previousContainer.Parent as LayoutGroupBase;
Expand Down