Share via


DependencyPropertyDescriptor.IsReadOnly 屬性

定義

取得值,表示這個屬性是否為唯讀。

public:
 virtual property bool IsReadOnly { bool get(); };
public override bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public Overrides ReadOnly Property IsReadOnly As Boolean

屬性值

如果屬性為唯讀,則為 true,否則為 false

備註

這個屬性相依基礎 PropertyDescriptor

相依性屬性會使用特定方法呼叫註冊為唯讀,而且依照慣例,CLR 包裝函式屬性是反映所檢視的屬性,而且描述元也必須是只讀的。 不過,由於這是慣例,而不是編譯的需求,因此您可能想要再次檢查相依性屬性標識碼只讀狀態。 若要這樣做,請取得標識碼 (DependencyProperty) 值 DependencyPropertyDescriptor ,然後檢查的值 ReadOnly。 請注意,位於 ReadOnly 標識碼本身,而不是元數據。

適用於