TextFormattingRunProperties Class

Definition

Holds text formatting property information. This class derives from the abstract TextRunProperties class.

public ref class TextFormattingRunProperties sealed : System::Windows::Media::TextFormatting::TextRunProperties, System::Runtime::Serialization::IObjectReference, System::Runtime::Serialization::ISerializable
[System.Serializable]
public sealed class TextFormattingRunProperties : System.Windows.Media.TextFormatting.TextRunProperties, System.Runtime.Serialization.IObjectReference, System.Runtime.Serialization.ISerializable
type TextFormattingRunProperties = class
    inherit TextRunProperties
    interface ISerializable
    interface IObjectReference
Public NotInheritable Class TextFormattingRunProperties
Inherits TextRunProperties
Implements IObjectReference, ISerializable
Inheritance
TextFormattingRunProperties
Attributes
Implements

Remarks

This class is used to hold all information about the text formatting properties. Once created, it is immutable and all operations return different objects. For each unique set of TextFormattingRunProperties there exists exactly one object instance. If a TextFormattingRunProperties has reference equality to another, their properties are identical. Conversely, if a TextFormattingRunProperties object has reference inequality, the properties are distinct.

Checking reference equality is the only way to determine whether two TextFormattingRunProperties are distinct. Checking the equality of each property of the object may indicate the two are identical, but that may or may not be the case.

TextFormattingRunProperties may have empty properties. An empty property inherits the empty properties from some additional text. The TextFormattingRunProperties object can determine whether a property is empty or not: [PropertyName]Empty property. TextFormattingRunProperties also contains a facility for emptying a property: Clear[PropertyName]().

All freezable fields of the TextFormattingRunProperties object are frozen on creation.

Properties

BackgroundBrush

Gets the background brush.

BackgroundBrushEmpty

Determines whether the background brush is empty.

BackgroundOpacity

Returns the opacity of the background.

BackgroundOpacityEmpty

Determines whether any custom opacity is explicitly set for the background.

Bold

Determines whether the formatting is made explicitly bold.

BoldEmpty

Determines whether the bold property is set.

CultureInfo

Gets the culture information.

CultureInfoEmpty

Determines whether the culture info is empty.

FontHintingEmSize

Gets the font hinting size.

FontHintingEmSizeEmpty

Determines whether the font hinting size is empty.

FontRenderingEmSize

Gets the font rendering size.

FontRenderingEmSizeEmpty

Determines whether the size is empty.

ForegroundBrush

Gets the foreground brush.

ForegroundBrushEmpty

Determines whether the foreground brush is empty.

ForegroundOpacity

Gets the opacity of the foreground.

ForegroundOpacityEmpty

Determines whether any custom opacity is explicitly set for the foreground.

Italic

Determines whether the formatting is made explicitly italic.

ItalicEmpty

Determines whether the italic property is set.

TextDecorations

Gets the decorations for the text.

TextDecorationsEmpty

Determines whether the text decorations collection is empty.

TextEffects

Gets the text effects for the text.

TextEffectsEmpty

Determines whether the text effects collection is empty.

Typeface

Gets the typeface for the text.

TypefaceEmpty

Determines whether the typeface is empty.

Methods

BackgroundBrushSame(Brush)

Determines whether the background brush for this TextFormattingRunProperties is the same as the specified brush.

ClearBackgroundBrush()

Gets a new TextFormattingRunProperties with all properties the same except for the background brush.

ClearBackgroundOpacity()

Gets a new TextFormattingRunProperties with the BackgroundOpacity property cleared.

ClearBold()

Gets a new TextFormattingRunProperties with the Bold property cleared.

ClearCultureInfo()

Gets a new TextFormattingRunProperties with all properties the same except for the culture info.

ClearFontHintingEmSize()

Gets a new TextFormattingRunProperties with all properties the same except for the font hinting size.

ClearFontRenderingEmSize()

Gets a new TextFormattingRunProperties with all properties the same except for the rendering size.

ClearForegroundBrush()

Gets a new TextFormattingRunProperties with all properties the same except for the foreground brush.

ClearForegroundOpacity()

Gets a new TextFormattingRunProperties with the ForegroundOpacity property cleared.

ClearItalic()

Gets a new TextFormattingRunProperties with all properties the same, but clears the Italic property.

ClearTextDecorations()

Gets a new TextFormattingRunProperties with all properties the same except for the text decorations.

ClearTextEffects()

Gets a new TextFormattingRunProperties with all properties the same except for the text effects.

ClearTypeface()

Gets a new TextFormattingRunProperties with all properties the same except for the typeface.

CreateTextFormattingRunProperties()

Initializes a new instance of TextFormattingRunProperties.

CreateTextFormattingRunProperties(Brush, Brush, Typeface, Nullable<Double>, Nullable<Double>, TextDecorationCollection, TextEffectCollection, CultureInfo)

Initializes a new instance of TextFormattingRunProperties with the specified options.

CreateTextFormattingRunProperties(Typeface, Double, Color)

Initializes a new instance of TextFormattingRunProperties with the specified options.

ForegroundBrushSame(Brush)

Determines whether the foreground brush for this TextFormattingRunProperties is the same as the specified.

GetObjectData(SerializationInfo, StreamingContext)

Serializes the TextFormattingRunProperties object using a XamlWriter.

GetRealObject(StreamingContext)

Gets the cached TextFormattingRunProperties object, or creates one if none exists.

SameSize(TextFormattingRunProperties)

Determines whether font sizes for two TextFormattingRunProperties objects are the same.

SetBackground(Color)

Gets a new TextFormattingRunProperties with the properties of this one but with the background set to the specified color.

SetBackgroundBrush(Brush)

Gets a new TextFormattingRunProperties with the properties of this one but with the background brush set to the specified brush.

SetBackgroundOpacity(Double)

Gets a new TextFormattingRunProperties with the BackgroundOpacity property set to the specified opacity.

SetBold(Boolean)

Returns a new TextFormattingRunProperties with the properties of this one but with the Bold property set the specified bold value.

SetCultureInfo(CultureInfo)

Gets a new TextFormattingRunProperties with the properties of this one but with the culture set to the specified culture information.

SetFontHintingEmSize(Double)

Gets a new TextFormattingRunProperties with the properties of this one but with the font hinting size set to the specified size.

SetFontRenderingEmSize(Double)

Gets a new TextFormattingRunProperties with the properties of this one but with the font rendering size set to the specified size.

SetForeground(Color)

Gets a new TextFormattingRunProperties with the properties of this one but with the foreground set to the specified color

SetForegroundBrush(Brush)

Gets a new TextFormattingRunProperties with the properties of this one but with the new foreground Brush set to the specified brush.

SetForegroundOpacity(Double)

Gets a new TextFormattingRunProperties with the properties of this one but with the ForegroundOpacity property set to the specified opacity.

SetItalic(Boolean)

Gets a new TextFormattingRunProperties with the properties of this one but with the Italic property set to the italic value.

SetTextDecorations(TextDecorationCollection)

Gets a new TextFormattingRunProperties with the properties of this one but with the text decorations set to the specified text decorations.

SetTextEffects(TextEffectCollection)

Gets a new TextFormattingRunProperties with the properties of this one but with the text effects set to the specified text effects.

SetTypeface(Typeface)

Gets a new TextFormattingRunProperties with the properties of this one but with the typeface set to the specified typeface.

Applies to