diff --git a/source/Components/AvalonDock/Controls/LayoutDocumentItem.cs b/source/Components/AvalonDock/Controls/LayoutDocumentItem.cs index 915e6863..a6715de7 100644 --- a/source/Components/AvalonDock/Controls/LayoutDocumentItem.cs +++ b/source/Components/AvalonDock/Controls/LayoutDocumentItem.cs @@ -1,4 +1,4 @@ -/************************************************************************ +/************************************************************************ AvalonDock Copyright (C) 2007-2013 Xceed Software Inc. @@ -100,6 +100,11 @@ internal override void Detach() base.Detach(); } + protected override bool CanExecuteDockAsDocumentCommand() + { + return (LayoutElement != null && LayoutElement.FindParent() != null && LayoutElement.IsFloating); + } + #endregion Overrides } } \ No newline at end of file diff --git a/source/Components/AvalonDock/Layout/LayoutContent.cs b/source/Components/AvalonDock/Layout/LayoutContent.cs index 9e4f6c57..95d13af4 100644 --- a/source/Components/AvalonDock/Layout/LayoutContent.cs +++ b/source/Components/AvalonDock/Layout/LayoutContent.cs @@ -647,7 +647,6 @@ public void Float() public void DockAsDocument() { if (!(Root is LayoutRoot root)) throw new InvalidOperationException(); - if (Parent is LayoutDocumentPane) return; if (PreviousContainer is LayoutDocumentPane) {