Share via


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 文字上延伸,並傳回具有兩個或多個不同值的 formattingProperty 文字 UnsetValue

適用於

另請參閱