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 a new instance of the TwoLineLabel class.

public TwoLineLabel()

Properties

HasPopup

Gets or sets 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

Gets the text to display on the first line.

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

Property Value

string:

The text to display on the first line.

Line2Text

Gets the text to display on the second line.

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

Property Value

string:

The text to display on the second line.

PopupIndicator

Gets or sets the popup indicator content.

public object PopupIndicator { get; set; }

Property Value

object:

The popup indicator content.

PopupIndicatorTemplate

Gets or sets the DataTemplate for the popup indicator content.

public DataTemplate PopupIndicatorTemplate { get; set; }

Property Value

DataTemplate:

The DataTemplate for the popup indicator content.

Text

Gets or sets the text to display in the label.

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

Property Value

string:

The text to display in the label.

UseSingleLine

Gets or sets 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

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

public static readonly DependencyProperty HasPopupProperty

Line1TextProperty

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

public static readonly DependencyProperty Line1TextProperty

Line2TextProperty

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

public static readonly DependencyProperty Line2TextProperty

PopupIndicatorProperty

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

public static readonly DependencyProperty PopupIndicatorProperty

PopupIndicatorTemplateProperty

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

public static readonly DependencyProperty PopupIndicatorTemplateProperty

TextProperty

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

public static readonly DependencyProperty TextProperty

UseSingleLineProperty

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

public static readonly DependencyProperty UseSingleLineProperty