Convert a dependency property to a read-only dependency property
ProprietaryRewrites DependencyProperty.Register to RegisterReadOnly, holding the result in a private DependencyPropertyKey and exposing <key>.DependencyProperty under the original name. Every SetValue on the property inside the declaring type is moved onto the key, which is the only way a read-only dependency property can be written.
OpenRewrite. Recipes. CSharp. CodeQuality. Wpf. ConvertDependencyPropertyToReadOnlymod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Wpf. ConvertDependencyPropertyToReadOnlyInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.