Set a readonly DependencyProperty using its DependencyPropertyKey

Proprietary

A read-only DependencyProperty can only be written through the DependencyPropertyKey it was registered with; passing the exposed DependencyProperty to SetValue or SetCurrentValue throws at run time. Replaces the call with SetValue(<Name>PropertyKey, ...).

OpenRewrite.Recipes.CSharp.CodeQuality.Wpf.UseDependencyPropertyKeyToSetValue
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Wpf.UseDependencyPropertyKeyToSetValue

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.