Class Label
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Static or real-time text: single line (with ellipsis) or wrapped multi-line text, aligned in its bounds. Set TextSource to refresh the text on every frame (CPU load, voice count, tempo...).
public class Label : UIElement
- Inheritance
-
Label
- Inherited Members
Constructors
Label()
Creates an empty label.
public Label()
Label(string?)
Creates a label with a text.
public Label(string? text)
Parameters
textstring
Properties
Background
Optional background fill.
public Color? Background { get; set; }
Property Value
CornerRadius
Corner radius of the background.
public float CornerRadius { get; set; }
Property Value
EffectiveTextStyle
Text style in effect.
protected TextStyle EffectiveTextStyle { get; }
Property Value
Foreground
Text color (null = theme text color, or dimmed text when IsDim).
public Color? Foreground { get; set; }
Property Value
IsDim
Uses the theme's secondary text color.
public bool IsDim { get; set; }
Property Value
Padding
Inner spacing around the text.
public Thickness Padding { get; set; }
Property Value
Text
Displayed text.
public string? Text { get; set; }
Property Value
TextAlignment
Horizontal text alignment (null = from the text style).
public HorizontalAlignment? TextAlignment { get; set; }
Property Value
TextSource
Called on every frame while attached: its result replaces Text when it changes (real-time text). Null stops the refresh.
[Browsable(false)]
public Func<string>? TextSource { get; set; }
Property Value
TextStyle
Text style (null = theme normal text).
public TextStyle? TextStyle { get; set; }
Property Value
VerticalTextAlignment
Vertical text alignment (null = from the text style).
public VerticalAlignment? VerticalTextAlignment { get; set; }
Property Value
Wrap
Wraps on word boundaries (multi-line).
public bool Wrap { get; set; }
Property Value
Methods
MeasureOverride(Size)
Natural size of the content for the available size (margins excluded).
protected override Size MeasureOverride(Size available)
Parameters
availableSize
Returns
OnAttached()
Called when the element joins a host (subscribe to external events here).
protected override void OnAttached()
OnDetached()
Called when the element leaves its host (unsubscribe here).
protected override void OnDetached()
OnRender(DrawingContext)
Draws the element (below its children).
protected override void OnRender(DrawingContext dc)