TextBlock
Measures and draws text from an ordered collection of formatted Run instances, caching per-character size and baseline information for rendering.
Definition
Namespace:Telerik.WinControls.RichTextEditor.UI
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class TextBlock : FrameworkElement, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, ISupportDrop
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementUIElementFrameworkElementTextBlock...
Implements:
Inherited Members
Constructors
Initializes an empty inline collection and tracks its changes to update Text and invalidate cached measurements.
public TextBlock()
Fields
Identifies the Telerik property-system registration for FontFamily.
public static readonly RadProperty FontFamilyProperty
Identifies the Telerik property-system registration for FontSize.
public static readonly RadProperty FontSizeProperty
Identifies the Telerik property-system registration for FontStyle.
public static readonly RadProperty FontStyleProperty
Identifies the Telerik property-system registration for FontWeight.
public static readonly RadProperty FontWeightProperty
Identifies the Telerik property-system registration for LineHeight.
public static RadProperty LineHeightProperty
Identifies the Telerik property-system registration for LineStackingStrategy.
public static RadProperty LineStackingStrategyProperty
Properties
Gets or sets the baseline offset used when drawing runs. Measurement recalculates it from the text metrics of the inline runs.
public double BaselineOffset { get; set; }
Gets or sets the text direction used when rendering Text without inline runs.
public FlowDirection FlowDirection { get; set; }
Gets or sets the brush copied to the temporary run used when Inlines is empty. Only a SolidBrush is copied; other brush types fall back to the element's foreground color.
public Brush Foreground { get; set; }
Gets the runs rendered in order by this block. Collection changes, including changes to a run's properties, update Text and invalidate cached measurements.
public ItemNotifyCollection<Run> Inlines { get; }
Gets or sets a line-height value and invalidates cached measurements when it changes. The WinForms measurement code does not use this value to calculate the block's height.
public double LineHeight { get; set; }
Gets or sets a line-stacking strategy value. The WinForms measurement code does not use this value to calculate the block's height.
public LineStackingStrategy LineStackingStrategy { get; set; }
Gets or sets horizontal alignment for rendered runs. The WinForms renderer applies left, center, and right alignment; Justify is rendered as left-aligned text.
public TextAlignment TextAlignment { get; set; }
Methods
Draws unrotated runs with the native text renderer. Override this method to customize that rendering path.
Draws rotated runs with GDI+. Override this method to customize the rotated rendering path.
Measures the runs and caches their character metrics. Changes to inline runs or layout-affecting block properties invalidate the cache; otherwise measurements are reused when the available size and scale match.
Draws the text, selecting GDI for an unrotated element and GDI+ when the element is rotated.
Returns the literal string TextBlock{0}; the current format string does not include the block's text.