Export (0) Print
Expand All

TextRange.GetPropertyValue Method

Returns the effective value of a specified formatting property on the current selection.

Namespace:  System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)

public Object GetPropertyValue(
	DependencyProperty formattingProperty
)

Parameters

formattingProperty
Type: System.Windows.DependencyProperty

A formatting property to get the value of with respect to the current selection.

Return Value

Type: System.Object
An object specifying the value of the specified formatting property.

ExceptionCondition
ArgumentException

Occurs when formattingProperty does not specify a valid formatting property, or value specifies an invalid value for formattingProperty.

ArgumentNullException

Occurs when formattingProperty is null.

In order to return a property value, the entire TextRange must extend over text with only one value for the formattingProperty. If the TextRange extends over text with two or more different values for the formattingProperty, UnsetValue is returned.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft