In This Article

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 AdvancedTextBlock class.

public AdvancedTextBlock()

Properties

Captures

Gets or sets the collection of text captures to highlight.

public IEnumerable<StringFilterCapture> Captures { get; set; }

Property Value

IEnumerable<StringFilterCapture>:

The collection of text captures to highlight.

HasToolTipOnOverflow

Gets or sets whether the control's tool tip is automatically set to the Text value when overflowed.

public bool HasToolTipOnOverflow { get; set; }

Property Value

bool:

true if the control's tool tip is automatically set to the Text value when overflowed; otherwise, false. The default value is true.

HighlightBackground

Gets or sets the background Brush to use for highlighted capture ranges.

public Brush HighlightBackground { get; set; }

Property Value

Brush:

The background Brush to use for highlighted capture ranges.

HighlightFontWeight

Gets or sets the FontWeight to use for highlighted capture ranges.

public FontWeight HighlightFontWeight { get; set; }

Property Value

FontWeight:

The FontWeight to use for highlighted capture ranges. The default value is Bold.

HighlightForeground

Gets or sets the foreground Brush to use for highlighted capture ranges.

public Brush HighlightForeground { get; set; }

Property Value

Brush:

The foreground Brush to use for highlighted capture ranges.

IsOverflowed

Gets whether the text is overflowed.

public bool IsOverflowed { get; }

Property Value

bool:

true if the text is overflowed; otherwise, false.

Text

Gets or sets the text string to render.

public string Text { get; set; }

Property Value

string:

The text string to render.

TextTrimming

Gets or sets the TextTrimming mode to use.

public TextTrimming TextTrimming { get; set; }

Property Value

TextTrimming:

The TextTrimming mode to use. The default value is CharacterEllipsis.

Methods

ArrangeOverride(Size)

When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.

protected override Size ArrangeOverride(Size finalSize)
Parameter Type Description
finalSize Size

The final area within the parent that this element should use to arrange itself and its children.

Returns

Size:

The actual size used.

OnApplyTemplate()

Invoked whenever application code or internal processes call ApplyTemplate.

public override void OnApplyTemplate()

OnCreateAutomationPeer()

Returns an AutomationPeer object for this control instance.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

An AutomationPeer instance.

Fields

CapturesProperty

Identifies the Captures dependency property. This field is read-only.

public static readonly DependencyProperty CapturesProperty

HasToolTipOnOverflowProperty

Identifies the HasToolTipOnOverflow dependency property. This field is read-only.

public static readonly DependencyProperty HasToolTipOnOverflowProperty

HighlightBackgroundProperty

Identifies the HighlightBackground dependency property. This field is read-only.

public static readonly DependencyProperty HighlightBackgroundProperty

HighlightFontWeightProperty

Identifies the HighlightFontWeight dependency property. This field is read-only.

public static readonly DependencyProperty HighlightFontWeightProperty

HighlightForegroundProperty

Identifies the HighlightForeground dependency property. This field is read-only.

public static readonly DependencyProperty HighlightForegroundProperty

IsOverflowedProperty

Identifies the IsOverflowed dependency property. This field is read-only.

public static readonly DependencyProperty IsOverflowedProperty

TextProperty

Identifies the Text dependency property. This field is read-only.

public static readonly DependencyProperty TextProperty

TextTrimmingProperty

Identifies the TextTrimming dependency property. This field is read-only.

public static readonly DependencyProperty TextTrimmingProperty