DockArea Enum
April 27, 2025 ยท View on GitHub
AcrylicUI.Docking.DockArea is an enumeration used to define the different regions within a DockPanel where content can be docked.
Enum Values
None: Represents an unknown or invalid area. Content is typically not in this state while docked.Document: The central area, usually displaying tabbed documents.Left: The region docked to the left edge of theDockPanel.Right: The region docked to the right edge of theDockPanel.Bottom: The region docked to the bottom edge of theDockPanel.Top: (Value exists but seems unused in current examples/implementation - typically main menus/toolbars occupy the top).
Usage
This enum is primarily used in two ways:
-
Setting Default Location: Assign a
DockAreavalue to theDefaultDockAreaproperty of aDockContent(or derivedDocument/ToolWindow) instance before adding it to theDockPanel. This suggests where the content should initially appear.using AcrylicUI.Docking; // ... inside your form or setup code ... var myToolWindow = new MyToolWindow(); myToolWindow.DefaultDockArea = DockArea.Right; // Suggest docking to the right myDockPanel.AddContent(myToolWindow); var myDocument = new MyDocument(); // No need to set DefaultDockArea for Document, it defaults to DockArea.Document myDockPanel.AddContent(myDocument); -
Checking Current Location: You can query the
DockAreaproperty of aDockContentinstance to determine where it is currently located within theDockPanel.using AcrylicUI.Docking; // ... DockContent currentContent = myDockPanel.ActiveContent; if (currentContent != null) { DockArea area = currentContent.DockArea; // area will be DockArea.Document, DockArea.Left, etc. if (area == DockArea.Left) { // Content is currently in the left region } } -
Accessing Regions: Used internally by
DockPanelto manage itsDockRegioncollections.
See also: DockPanel, DockContent, DockRegion