In This Article

TwoLineLabel Class

Represents a control that can render one or two lines of text, ideal for displaying a bar button's label when the button is a large variant size.

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

Constructors

TwoLineLabel()

Initializes an instance of the class.

public TwoLineLabel()

Properties

HasPopup

Indicates whether the label displays a popup indicator.

public bool HasPopup { get; set; }

Property Value

bool:

true if the label displays a popup indicator; otherwise, false. The default value is false.

Line1Text

The text to display on the first line.

[Localizability(LocalizationCategory.Label)]
public string? Line1Text { get; }

Property Value

string

Line2Text

The text to display on the second line.

[Localizability(LocalizationCategory.Label)]
public string? Line2Text { get; }

Property Value

string

PopupIndicator

The popup indicator content.

public object? PopupIndicator { get; set; }

Property Value

object

PopupIndicatorTemplate

The DataTemplate for the popup indicator content.

public DataTemplate? PopupIndicatorTemplate { get; set; }

Property Value

DataTemplate

Text

The text to display in the label.

[Localizability(LocalizationCategory.Label)]
public string? Text { get; set; }

Property Value

string

UseSingleLine

Indicates whether to use a single line for display.

public bool UseSingleLine { get; set; }

Property Value

bool:

true if single line should be used; otherwise, false. The default value is false.

Methods

MeasureOverride(Size?)

Called to remeasure a control.

protected override Size? MeasureOverride(Size? constraint)
Parameter Type Description
constraint Size

The maximum size that the method can return.

Returns

Size:

The size of the control, up to the maximum specified by constraint.

Fields

HasPopupProperty

Defines the HasPopup property.

public static readonly DependencyProperty HasPopupProperty

Line1TextProperty

Defines the Line1Text property.

public static readonly DependencyProperty Line1TextProperty

Line2TextProperty

Defines the Line2Text property.

public static readonly DependencyProperty Line2TextProperty

PopupIndicatorProperty

Defines the PopupIndicator property.

public static readonly DependencyProperty PopupIndicatorProperty

PopupIndicatorTemplateProperty

Defines the PopupIndicatorTemplate property.

public static readonly DependencyProperty PopupIndicatorTemplateProperty

TextProperty

Defines the Text property.

public static readonly DependencyProperty TextProperty

UseSingleLineProperty

Defines the UseSingleLine property.

public static readonly DependencyProperty UseSingleLineProperty

Extension Methods