TextRange.GetPropertyValue(DependencyProperty) 方法

定义

返回当前选定内容上指定格式属性的有效值。

public:
 System::Object ^ GetPropertyValue(System::Windows::DependencyProperty ^ formattingProperty);
public object GetPropertyValue(System.Windows.DependencyProperty formattingProperty);
member this.GetPropertyValue : System.Windows.DependencyProperty -> obj
Public Function GetPropertyValue (formattingProperty As DependencyProperty) As Object

参数

formattingProperty
DependencyProperty

一个格式化属性,用于获取相对于当前所选内容的值。

返回

一个对象,指定指定格式设置属性的值。

例外

在未指定有效格式属性或formattingProperty指定无效值时valueformattingProperty发生。

formattingPropertynull.

注解

为了返回属性值,整个 TextRange 值必须扩展到只有一个值 formattingProperty的文本上。 TextRange如果扩展的文本具有两个或多个不同值formattingPropertyUnsetValue则返回。

适用于

另请参阅