Table of Contents

Class DockLayout

Namespace
BSGameLib.UI.Controls
Assembly
BSGameLib.UI.dll

A layout that docks each child to an edge of the layout, in the order they were added. The space left over goes to the child that fills it.

public class DockLayout : LayoutControl, IUpdateable, IEquatable<IUpdateable>, IDrawable, IIdentifiable<Guid>, IEquatable<IDrawable>, IDisposable
Inheritance
DockLayout
Implements
Inherited Members

Constructors

DockLayout(ILogger, View, string)

Creates a dock layout in view.

public DockLayout(ILogger logger, View view, string id = null)

Parameters

logger ILogger
view View
id string

Properties

LastChildFill

Whether the last visible child takes the space left after the others are docked, whatever its edge. When false, it is docked to its own edge like the rest.

public bool LastChildFill { get; set; }

Property Value

bool

Padding

The space kept clear inside the layout's edges, around the docked children.

public Spacing Padding { get; set; }

Property Value

Spacing

Methods

AddChild(UIElement)

Adds child docked to Fill.

public override void AddChild(UIElement child)

Parameters

child UIElement

AddChild(UIElement, DockDirection)

Adds child docked to the edge dock.

public void AddChild(UIElement child, DockDirection dock)

Parameters

child UIElement
dock DockDirection

ArrangeControls()

Places each visible child at its dock edge, in the order they were added.

protected override void ArrangeControls()

ClearChildren()

Removes every child and its dock setting.

public override void ClearChildren()

GetDesiredSize()

The size this layout asks for, from what its visible children need and the padding it keeps.

protected override Vector2 GetDesiredSize()

Returns

Vector2

GetDock(UIElement)

Returns the edge child is docked to. Fill for a child the layout does not hold.

public DockDirection GetDock(UIElement child)

Parameters

child UIElement

Returns

DockDirection

RemoveChild(UIElement)

Removes child and its dock setting.

public override void RemoveChild(UIElement child)

Parameters

child UIElement

SetDock(UIElement, DockDirection)

Docks child to the edge dock. Does nothing when the child is not in this layout.

public void SetDock(UIElement child, DockDirection dock)

Parameters

child UIElement
dock DockDirection