Class DockWorkspace

Namespace
Forma
Assembly
Forma.dll

Root of a docking workspace. Holds a logical tree of panes and splits, and rebuilds the control tree from it whenever the layout changes.

public sealed class DockWorkspace : Container, IAddChild<Control>, IAddChild, INotifyPropertyChanged
Inheritance
DockWorkspace
Implements
Inherited Members

Remarks

The layout is modelled separately from the controls on purpose. SplitContainer is a TemplatedControl, and detaching one from its parent and re-adding it leaves it unusable — it either stops laying out or throws ObjectDisposedException from ApplyTemplate on the next frame. Earlier versions of this type mutated the live control tree in place and hit exactly that. Splits are therefore never reparented or reordered: each rebuild creates fresh ones and only the DockPanes (plain containers, safe to reparent) are carried over. Split offsets live on the logical nodes so a rebuild does not throw away the user's sizing.

Constructors

DockWorkspace()

public DockWorkspace()

Methods

ArrangeChildren()

protected override void ArrangeChildren()

CreatePane()

public DockPane CreatePane()

Returns

DockPane

DescribeTree()

Renders the current layout tree as text. Intended for diagnostics and tests.

public string DescribeTree()

Returns

string

Dock(DockPane, DockPane, DockZone)

Docks pane against target, splitting it in the given direction. This is the programmatic form of the drag-and-drop path and shares its implementation, so a layout built in code and one built by dragging agree.

public SplitContainer Dock(DockPane pane, DockPane target, DockZone zone)

Parameters

pane DockPane
target DockPane
zone DockZone

Returns

SplitContainer

The split that now holds both panes, or null for a centre dock, which merges tabs instead of splitting.

GetMinimumSize()

public override Vector2 GetMinimumSize()

Returns

Vector2