In This Article

TwoLineLabel Class

Represents a label control that renders its text on two lines for large buttons.

public class TwoLineLabel : Decorator
Inheritance:
object Visual UIElement FrameworkElement Decorator object

Constructors

TwoLineLabel()

Initializes an instance of the class.

public TwoLineLabel()

Properties

Foreground

Gets or sets the foreground Brush.

public Brush Foreground { get; set; }

Property Value

Brush:

The foreground Brush.

IsStateActive

Gets or sets whether a state is active.

public bool IsStateActive { get; set; }

Property Value

bool:

true if a state is active; otherwise, false.

Label

Gets or sets the text label.

public string Label { get; set; }

Property Value

string:

The text label.

StateForeground

Gets or sets the state foreground Brush.

public Brush StateForeground { get; set; }

Property Value

Brush:

The state foreground Brush.

Methods

ArrangeOverride(Size)

When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.

protected override Size ArrangeOverride(Size finalSize)
Parameter Type Description
finalSize Size

The final area within the parent that this element should use to arrange itself and its children.

Returns

Size:

The actual size used.

MeasureOverride(Size)

When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

OnRender(DrawingContext)

When overridden in a derived class, participates in rendering operations that are directed by the layout system. The rendering instructions for this element are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.

protected override void OnRender(DrawingContext drawingContext)
Parameter Type Description
drawingContext DrawingContext

The drawing instructions for a specific element. This context is provided to the layout system.

Fields

ForegroundProperty

Identifies the Foreground dependency property. This field is read-only.

public static readonly DependencyProperty ForegroundProperty

IsStateActiveProperty

Identifies the IsStateActive dependency property. This field is read-only.

public static readonly DependencyProperty IsStateActiveProperty

LabelProperty

Identifies the Label dependency property. This field is read-only.

public static readonly DependencyProperty LabelProperty

StateForegroundProperty

Identifies the StateForeground dependency property. This field is read-only.

public static readonly DependencyProperty StateForegroundProperty