What is the best way to create a read-only dependency property in WinRT?

There is no equivalent to RegisterReadOnly in WinRT.

Is there a good workaround?

How do controls in WinRT implement things like ActualWidthProperty?

+6
source share
1 answer

When implementing the use of dependency properties, they usually determine the static type of the property with metadata, and then you create an accessible property using getter and setter, so if you want to create the readonly property, just create the visible property using getter only.

0
source

All Articles