public void Unpin(ToolPaneGroup toolPaneGroup) { System.Diagnostics.Trace.Assert(toolPaneGroup != null); IUnpinnedToolHost.UnpinToolPane(toolPaneGroup, out UnpinnedToolData unpinnedToolData, out WindowLocation toolListBoxLocation); AddUnpinnedToolData(unpinnedToolData, toolListBoxLocation, IUnpinnedToolHost.GetToolListBox(toolListBoxLocation)); }
ToolPaneGroup ILayoutFactory.MakeToolPaneGroup() { ToolPaneGroup toolPaneGroup = new ToolPaneGroup(); IDockPaneManager.RegisterDockPane(toolPaneGroup); toolPaneGroup.UnPinClick += ToolPane_UnPinClick; return(toolPaneGroup); }
public void MakeUnpinnedToolPaneGroup(WindowLocation windowLocation, ToolPaneGroup toolPaneGroup, string siblingGuid, bool isHorizontal, bool isFirst) { Controls.IToolListBox iToolListBox = IUnpinnedToolHost.GetToolListBox(windowLocation); System.Diagnostics.Trace.Assert(iToolListBox != null); System.Diagnostics.Trace.Assert(toolPaneGroup != null); UnpinnedToolData unpinnedToolData = new UnpinnedToolData(); unpinnedToolData.ToolPaneGroup = toolPaneGroup; unpinnedToolData.SiblingGuid = new Guid(siblingGuid); unpinnedToolData.IsFirst = isFirst; unpinnedToolData.IsHorizontal = isHorizontal; AddUnpinnedToolData(unpinnedToolData, windowLocation, iToolListBox); }
void IUnpinnedToolHost.UnpinToolPane(ToolPaneGroup toolPaneGroup, out UnpinnedToolData unpinnedToolData, out WindowLocation toolListBoxLocation) { IDockPaneManager.UnpinToolPane(toolPaneGroup, out unpinnedToolData, out toolListBoxLocation); }
void ILayoutFactory.MakeUnpinnedToolPaneGroup(WindowLocation windowLocation, ToolPaneGroup toolPaneGroup, string siblingGuid, bool isHorizontal, bool isFirst) { IUnpinnedToolManager.MakeUnpinnedToolPaneGroup(windowLocation, toolPaneGroup, siblingGuid, isHorizontal, isFirst); }
public void UnpinToolPane(ToolPaneGroup toolPaneGroup, out UnpinnedToolData unpinnedToolData, out WindowLocation toolListBoxLocation) { System.Diagnostics.Trace.Assert(toolPaneGroup != null); DocumentPanel documentPanel = FindElementOfType(typeof(DocumentPanel), IDockPaneHost.RootPane) as DocumentPanel; System.Diagnostics.Trace.Assert(documentPanel != null); List <Grid> documentPanelAncestors = new List <Grid>(); Grid grid = documentPanel; while (grid.Parent != IDockPaneHost) { grid = grid.Parent as SplitterPane; documentPanelAncestors.Add(grid); } /* * Find the first common ancestor for the document panel and the tool pane group */ FrameworkElement frameworkElement = toolPaneGroup; while (true) { if (documentPanelAncestors.Contains(frameworkElement.Parent as Grid)) { break; } frameworkElement = frameworkElement.Parent as FrameworkElement; } toolListBoxLocation = WindowLocation.None; bool isFirst = (Grid.GetRow(frameworkElement) == 0) && (Grid.GetColumn(frameworkElement) == 0); bool isHorizontal = (frameworkElement.Parent as SplitterPane).IsHorizontal; if (isHorizontal) { if (isFirst) { toolListBoxLocation = WindowLocation.TopSide; } else { toolListBoxLocation = WindowLocation.BottomSide; } } else { if (isFirst) { toolListBoxLocation = WindowLocation.LeftSide; } else { toolListBoxLocation = WindowLocation.RightSide; } } unpinnedToolData = new UnpinnedToolData(); unpinnedToolData.ToolPaneGroup = toolPaneGroup; Grid parentGrid = toolPaneGroup.Parent as Grid; unpinnedToolData.IsFirst = (Grid.GetRow(toolPaneGroup) == 0) && (Grid.GetColumn(toolPaneGroup) == 0); unpinnedToolData.IsHorizontal = (parentGrid as SplitterPane).IsHorizontal; ExtractDockPane(toolPaneGroup, out frameworkElement); System.Diagnostics.Trace.Assert(frameworkElement != null); unpinnedToolData.SiblingGuid = (Guid)((frameworkElement as Grid).Tag); }