Skip to end of metadata
Go to start of metadata

An abstract class used as the base class for the abstract Block and Inline classes.

Working with Background Property

Background property will result in different rendering for Block and Inline elements. FlowDocument will use the boundary of the element to render its background.

XAML

Working with Style Property

You can specify predefined styles that can be applied to all elements in FlowDocument, using FlowDocumentStyle collection. In FlowDocumentStyle, you can specify the fundamental element formatting, such as background, foreground, font-related properties, and border. Each FlowDocumentStyle should have a name, which will be referred from the element.

XAML

Definition

public abstract class TextElement : DependencyObject

Summary

The following table summarizes the members exposed in this class.

Protected Constructors

Public Properties

BackgroundGets or sets the Brush used to fill the background of the content area.
FontFamilyGets or sets the preferred top-level font family for the content of the element.
FontSizeGets or sets the font size for the content of the element.
FontStretchGets or sets the font-stretching characteristics for the content of the element.
FontStyleGets or sets the font style for the content of the element.
FontWeightGets or sets the top-level font weight for the content of the element.
ForegroundGets or sets the Brush to apply to the content of the element.
StyleGets or sets the style name that will be applied to the element.

Fields

BackgroundPropertyIdentifies the Background dependency property.
FontFamilyPropertyIdentifies the FontFamily dependency property.
FontSizePropertyIdentifies the FontSize dependency property.
FontStretchPropertyIdentifies the FontStretch dependency property.
FontStylePropertyIdentifies the FontStyle dependency property.
FontWeightPropertyIdentifies the FontWeight dependency property.
ForegroundPropertyIdentifies the Foreground dependency property.
StylePropertyIdentifies the Style dependency property.

Protected Constructors

protected TextElement()

 

Public Properties

public Brush Background { get; set; }

Gets or sets the Brush used to fill the background of the content area.

public FontFamily FontFamily { get; set; }

Gets or sets the preferred top-level font family for the content of the element.

public double FontSize { get; set; }

Gets or sets the font size for the content of the element.

public FontStretch FontStretch { get; set; }

Gets or sets the font-stretching characteristics for the content of the element.

public FontStyle FontStyle { get; set; }

Gets or sets the font style for the content of the element.

public FontWeight FontWeight { get; set; }

Gets or sets the top-level font weight for the content of the element.

public Brush Foreground { get; set; }

Gets or sets the Brush to apply to the content of the element.

public string Style { get; set; }

Gets or sets the style name that will be applied to the element.

Fields

public static readonly DependencyProperty BackgroundProperty

Identifies the Background dependency property.

public static readonly DependencyProperty FontFamilyProperty

Identifies the FontFamily dependency property.

public static readonly DependencyProperty FontSizeProperty

Identifies the FontSize dependency property.

public static readonly DependencyProperty FontStretchProperty

Identifies the FontStretch dependency property.

public static readonly DependencyProperty FontStyleProperty

Identifies the FontStyle dependency property.

public static readonly DependencyProperty FontWeightProperty

Identifies the FontWeight dependency property.

public static readonly DependencyProperty ForegroundProperty

Identifies the Foreground dependency property.

public static readonly DependencyProperty StyleProperty

Identifies the Style dependency property.

  • No labels