DependencyPropertyDescriptor.IsReadOnly Property

 

Gets a value indicating whether this property is read-only.

Namespace:   System.ComponentModel
Assembly:  WindowsBase (in WindowsBase.dll)

public override bool IsReadOnly { get; }

Property Value

Type: System.Boolean

true if the property is read-only; otherwise, false.

This property relies on the underlying PropertyDescriptor.

Dependency properties are registered as read-only using particular method calls, and by convention the CLR wrapper properties that are the properties viewed by reflection and the descriptors must also be read-only. However, since this is a convention and not a requirement to compile, you might want to double check the dependency property identifier read-only state. To do this, get the identifier (DependencyProperty) value for this DependencyPropertyDescriptor and then check the value of ReadOnly. Note that the ReadOnly is on the identifier itself, not metadata.

.NET Framework
Available since 3.0
Return to top
Show: