Note: This document is auto-generated by
scripts/generate_control_reference_docs.py. Do not edit manually.
Avalonia.Controls.TextBlockAvalonia.ControlsAvalonia.Controlssrc/Avalonia.Controls/TextBlock.csControl, IInlineHostcontrolpublic static readonly StyledProperty<IBrush?> BackgroundProperty = Border.BackgroundProperty.AddOwner<TextBlock>();public static readonly StyledProperty<Thickness> PaddingProperty = Decorator.PaddingProperty.AddOwner<TextBlock>();public static readonly StyledProperty<FontFamily> FontFamilyProperty = TextElement.FontFamilyProperty.AddOwner<TextBlock>();public static readonly StyledProperty<double> FontSizeProperty = TextElement.FontSizeProperty.AddOwner<TextBlock>();public static readonly StyledProperty<FontStyle> FontStyleProperty = TextElement.FontStyleProperty.AddOwner<TextBlock>();public static readonly StyledProperty<FontWeight> FontWeightProperty = TextElement.FontWeightProperty.AddOwner<TextBlock>();public static readonly StyledProperty<FontStretch> FontStretchProperty = TextElement.FontStretchProperty.AddOwner<TextBlock>();public static readonly StyledProperty<IBrush?> ForegroundProperty = TextElement.ForegroundProperty.AddOwner<TextBlock>();public static readonly AttachedProperty<double> BaselineOffsetProperty = AvaloniaProperty.RegisterAttached<TextBlock, Control, double>( nameof(BaselineOffset), 0, true);public static readonly AttachedProperty<double> LineHeightProperty = AvaloniaProperty.RegisterAttached<TextBlock, Control, double>( nameof(LineHeight), double.NaN, validate: IsValidLineHeight, inherits: true);public static readonly AttachedProperty<double> LineSpacingProperty = AvaloniaProperty.RegisterAttached<TextBlock, Control, double>( nameof(LineSpacing), 0, validate: IsValidLineSpacing, inherits: true);public static readonly AttachedProperty<double> LetterSpacingProperty = AvaloniaProperty.RegisterAttached<TextBlock, Control, double>( nameof(LetterSpacing), 0, inherits: true);public static readonly AttachedProperty<int> MaxLinesProperty = AvaloniaProperty.RegisterAttached<TextBlock, Control, int>( nameof(MaxLines), validate: IsValidMaxLines, inherits: true);public static readonly StyledProperty<string?> TextProperty = AvaloniaProperty.Register<TextBlock, string?>(nameof(Text));public static readonly AttachedProperty<TextAlignment> TextAlignmentProperty = AvaloniaProperty.RegisterAttached<TextBlock, Control, TextAlignment>( nameof(TextAlignment), defaultValue: TextAlignment.Start, inherits: true);public static readonly AttachedProperty<TextWrapping> TextWrappingProperty = AvaloniaProperty.RegisterAttached<TextBlock, Control, TextWrapping>(nameof(TextWrapping), inherits: true);<TextBlock x:Name="SampleTextBlock" />
using Avalonia.Controls;
var control = new TextBlock();