AdvancedTextBlock Class
Represents an advanced text block control that renders a single line of text but has additional highlighting and overflow options.
[TemplatePart(Name = "PART_TextBlock", Type = typeof(TextBlock))]
public class AdvancedTextBlock : Control
- Inheritance:
- object Visual UIElement FrameworkElement Control object
Constructors
AdvancedTextBlock()
Initializes an instance of the class.
public AdvancedTextBlock()
Properties
Captures
The collection of text captures to highlight.
public IEnumerable<StringFilterCapture>? Captures { get; set; }
Property Value
- IEnumerable<StringFilterCapture>:
The default value is
null.
HasToolTipOnOverflow
Indicates whether the control's tool tip is automatically set to the Text value when overflowed.
public bool HasToolTipOnOverflow { get; set; }
Property Value
HighlightBackground
The background Brush to use for highlighted capture ranges.
HighlightFontWeight
The FontWeight to use for highlighted capture ranges.
public FontWeight HighlightFontWeight { get; set; }
Property Value
- FontWeight:
The default value is
Bold.
HighlightForeground
The foreground Brush to use for highlighted capture ranges.
IsOverflowed
Indicates whether the text is overflowed.
public bool IsOverflowed { get; }
Property Value
- bool:
trueif the text is overflowed; otherwise,false.
Text
The text string to render.
TextTrimming
The TextTrimming mode to use.
public TextTrimming TextTrimming { get; set; }
Property Value
- TextTrimming:
The default value is CharacterEllipsis.
Methods
ArrangeOverride(Size)
Called to arrange and size the content of a Control object.
protected override Size ArrangeOverride(Size finalSize)
| Parameter | Type | Description |
|---|---|---|
| finalSize | Size |
Returns
- Size:
The size of the control.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
The type-specific AutomationPeer implementation.
Fields
CapturesProperty
Defines the Captures property.
public static readonly DependencyProperty CapturesProperty
HasToolTipOnOverflowProperty
Defines the HasToolTipOnOverflow property.
public static readonly DependencyProperty HasToolTipOnOverflowProperty
HighlightBackgroundProperty
Defines the HighlightBackground property.
public static readonly DependencyProperty HighlightBackgroundProperty
HighlightFontWeightProperty
Defines the HighlightFontWeight property.
public static readonly DependencyProperty HighlightFontWeightProperty
HighlightForegroundProperty
Defines the HighlightForeground property.
public static readonly DependencyProperty HighlightForegroundProperty
IsOverflowedProperty
Defines the IsOverflowed property.
public static readonly DependencyProperty IsOverflowedProperty
TextProperty
Defines the Text property.
public static readonly DependencyProperty TextProperty
TextTrimmingProperty
Defines the TextTrimming property.
public static readonly DependencyProperty TextTrimmingProperty