← All recipes
Moderne licensed

Use SetValue in setter

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Wpf.UseSetValueInClrPropertySetterArtifactOpenRewrite.Recipes.CSharp.CodeQuality

The set accessor of a CLR property wrapping a dependency property must call SetValue so the assignment becomes a local value. Replaces SetCurrentValue, substituting the DependencyPropertyKey when the dependency property is read-only.

Single recipecsharpcode-qualityProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe OpenRewrite.Recipes.CSharp.CodeQuality.Wpf.UseSetValueInClrPropertySetter

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQuality