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, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
- Inheritance:
- System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.FrameworkElement System.Windows.Controls.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
- System.Boolean:
true
if the label displays a popup indicator; otherwise,false
. The default value isfalse
.
Line1Text
Gets the text to display on the first line.
[Localizability(LocalizationCategory.Label)]
public string Line1Text { get; }
Property Value
- System.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
- System.String:
The text to display on the second line.
PopupIndicator
Gets or sets the popup indicator content.
public object PopupIndicator { get; set; }
Property Value
- System.Object:
The popup indicator content.
PopupIndicatorTemplate
Gets or sets the System.Windows.DataTemplate for the popup indicator content.
public DataTemplate PopupIndicatorTemplate { get; set; }
Property Value
- System.Windows.DataTemplate:
The System.Windows.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
- System.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
- System.Boolean:
true
if single line should be used; otherwise,false
. The default value isfalse
.
Methods
MeasureOverride(Size)
Called to remeasure a control.
protected override Size MeasureOverride(Size constraint)
Parameter | Type | Description |
---|---|---|
constraint | System.Windows.Size | The maximum size that the method can return. |
Returns
- System.Windows.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
Inherited Members
- System.Object.ToString()
- System.Object.Equals(System.Object)
- System.Object.Equals(System.Object, System.Object)
- System.Object.ReferenceEquals(System.Object, System.Object)
- System.Object.GetHashCode()
- System.Object.GetType()
- System.Object.MemberwiseClone()
Extension Methods
- FrameworkElementExtensions.AnimateDoubleProperty(String, Double, Double, Double, Nullable<Double>, Nullable<Double>)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, String, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, DependencyProperty, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.GetCurrentSize()