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


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.


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


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.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft