private DockTree(DockControl dockControl, FloatingWindow floatingWindow, DockTreePosition dockTreePosition) { DockControl = dockControl; _floatingWindow = floatingWindow; _panes = new DockPaneCollection(); _visiblePanes = new DockPaneCollection(); _activePanes = new DockPaneCollection(); _autoHidePanes = new DockPaneCollection(); _autoHideItems = new DockItemCollection(); _dirtyNodes = new List <DockPaneNode>(); Position = dockTreePosition; }
/// <summary>Initializes a new instance of the <see cref="DockControl"/> class.</summary> public DockControl() { bool designMode = DesignerProperties.GetIsInDesignMode(this); VerifyLicense(designMode); _dockItems = new DockItemCollection(this); _floatingWindows = new FloatingWindowCollection(); LeftDockTree = new DockTree(this, DockTreePosition.Left); RightDockTree = new DockTree(this, DockTreePosition.Right); TopDockTree = new DockTree(this, DockTreePosition.Top); BottomDockTree = new DockTree(this, DockTreePosition.Bottom); DocumentDockTree = new DockTree(this, DockTreePosition.Document); _undoStack = new UndoRedoStack <ICommand>(MaxUndoLevel); _redoStack = new UndoRedoStack <ICommand>(MaxUndoLevel); PaneManager = new DockPaneManager(this); this.Loaded += new RoutedEventHandler(OnLoaded); }
internal void PerformClose() { DockPaneCollection srcPanes = ActivePanes; DockPane[] panes = new DockPane[srcPanes.Count]; srcPanes.CopyTo(panes, 0); for (int i = panes.Length - 1; i >= 0; i--) { DockPane pane = panes[i]; DockItemCollection srcItems = pane.ActiveItems; DockItem[] items = new DockItem[srcItems.Count]; srcItems.CopyTo(items, 0); for (int j = items.Length - 1; j >= 0; j--) { items[j].PerformClose(); } } }
internal static void Load(DockControl dockControl, DockLayout layout, Func <object, DockItem> loadDockItemCallback) { Debug.Assert(dockControl.DockItems.Count == 0); dockControl.DockTreeZOrder = layout.DockTreeZOrder; dockControl.LeftDockTreeWidth = layout.LeftDockTreeWidth; dockControl.RightDockTreeWidth = layout.RightDockTreeWidth; dockControl.TopDockTreeHeight = layout.TopDockTreeHeight; dockControl.BottomDockTreeHeight = layout.BottomDockTreeHeight; DockItemCollection items = dockControl.DockItems; foreach (DockItemReference itemRef in layout.DockItems) { DockItem item = loadDockItemCallback == null ? (DockItem)itemRef.Target : loadDockItemCallback(itemRef.Target); item.AutoHideSize = itemRef.AutoHideSize; items.AddInternal(item); } foreach (ShowAction action in layout.ShowActions) { action.Run(dockControl); } }