private Rectangle GetPaneSplitterDragRectangle() { DockPaneSplitter splitter = DragControl as DockPaneSplitter; DockPane pane = splitter.DockPane; NestedDockingStatus status = pane.NestedDockingStatus; Rectangle rectLimit = status.LogicalBounds; rectLimit.Location = splitter.Parent.PointToScreen(rectLimit.Location); bool bVerticalSplitter; if (status.DisplayingAlignment == DockAlignment.Left || status.DisplayingAlignment == DockAlignment.Right) { rectLimit.X += MeasurePane.MinSize; rectLimit.Width -= 2 * MeasurePane.MinSize; bVerticalSplitter = true; } else { rectLimit.Y += MeasurePane.MinSize; rectLimit.Height -= 2 * MeasurePane.MinSize; bVerticalSplitter = false; } return(GetSplitterDragRectangle(rectLimit, bVerticalSplitter)); }
public void BeginDragPaneSplitter(DockPaneSplitter splitter) { if (!InitDrag(splitter, DragSource.PaneSplitter)) { return; } PaneSplitter_BeginDrag(splitter.Location); }
private void PaneSplitter_OnEndDrag(bool abort) { if (abort) { return; } Point pt = m_splitterLocation; Rectangle rect = GetPaneSplitterDragRectangle(); DockPaneSplitter splitter = DragControl as DockPaneSplitter; DockPane pane = splitter.DockPane; NestedDockingStatus status = pane.NestedDockingStatus; double proportion = status.Proportion; if (status.LogicalBounds.Width <= 0 || status.LogicalBounds.Height <= 0) { return; } else if (status.DisplayingAlignment == DockAlignment.Left) { proportion += ((double)rect.X - (double)pt.X) / (double)status.LogicalBounds.Width; } else if (status.DisplayingAlignment == DockAlignment.Right) { proportion -= ((double)rect.X - (double)pt.X) / (double)status.LogicalBounds.Width; } else if (status.DisplayingAlignment == DockAlignment.Top) { proportion += ((double)rect.Y - (double)pt.Y) / (double)status.LogicalBounds.Height; } else { proportion -= ((double)rect.Y - (double)pt.Y) / (double)status.LogicalBounds.Height; } pane.SetNestedDockingProportion(proportion); }