Skip to main content

ContentControl Class

NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls

Base class for controls that host a single child element.

public abstract class ContentControl : Control

Properties​

HorizontalContentAlignment​

public HorizontalAlignment HorizontalContentAlignment { get; set; }

Horizontal placement of Child within this control's content area. HorizontalAlignment.Stretch (the default) gives the child the full width and lets the child's own UIElement.HorizontalAlignment take effect (back-compat). Derived controls such as Button default this to HorizontalAlignment.Center.

VerticalContentAlignment​

public VerticalAlignment VerticalContentAlignment { get; set; }

Vertical placement of Child within this control's content area. See HorizontalContentAlignment for the Stretch/back-compat semantics.

Child​

public UIElement Child { get; set; }

The single child element hosted by this control.

Methods​

MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)​

protected override void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

Measures the child element.