Can't split two DockableContents in the DocumentPane
description
For example. I have 2 DockableContent docked in the DocumentPane one by one. If I try to dock one of them with DocumentPane splitting, the exception will happen.
System.InvalidOperationException: Specified element is already the logical child of another element. Disconnect it first.
at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
at MS.Internal.FrameworkObject.ChangeLogicalParent(DependencyObject newParent)
at System.Windows.FrameworkElement.AddLogicalChild(Object child)
at System.Windows.Controls.UIElementCollection.SetLogicalParent(UIElement element)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)
at System.Windows.Controls.UIElementCollection.Add(UIElement element)
at AvalonDock.DockingManager.Anchor(DockablePane paneToAnchor, DocumentPane relativePane, AnchorStyle anchor) in d:\projects\trade-lab\avalondock\dockingmanager.cs:line 819
at AvalonDock.DockingManager.Anchor(Pane paneToAnchor, Pane relativePane, AnchorStyle anchor) in d:\projects\trade-lab\avalondock\dockingmanager.cs:line 791
at AvalonDock.OverlayWindow.OnDrop(OverlayWindowDockingButton owdDock, Point point) in D:\Projects\Trade-lab\AvalonDock\OverlayWindow.cs:line 133
at AvalonDock.OverlayWindowDockingButton.OnDrop(Point point) in D:\Projects\Trade-lab\AvalonDock\OverlayWindowAnchorButton.cs:line 112
at AvalonDock.DragPaneServices.EndDrag(Point point) in D:\Projects\Trade-lab\AvalonDock\DrapPaneServices.cs:line 145
at AvalonDock.DockingManager.OnMouseUp(MouseButtonEventArgs e) in d:\projects\trade-lab\avalondock\dockingmanager.cs:line 1907
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
Probably, it happens because library is designed to use DocumentContent in the DocumentPane, but I doesn't need the DocumentContent in the application, only DockableContent is needed.