Edit this page

Read Only PropertyDefinition

This article shows how to control which property definitions to be read only.

If you want to control the read-only state of a PropertyDefinition, you can use the IsReadOnly property. You can bind it to a boolean property of your business object. Note that you need to specify the Source of the binding explicitly.

Here is a simple PropertyDefinition declaration:

[XAML] Example 1: Binding IsReadOnly property

            Binding="{Binding FirstName}" 
            DisplayName="First Name"
            IsReadOnly="{Binding  Path=IsActive, Source={StaticResource MyViewModel}}">