← All recipes
Moderne licensed

Set a mutable dependency property using SetCurrentValue

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Wpf.UseSetCurrentValueForMutablePropertyArtifactOpenRewrite.Recipes.CSharp.CodeQuality

Assigning a dependency property's CLR property, or calling SetValue, writes the local value and permanently outranks any binding, style, trigger or animation on that property. Replaces both with SetCurrentValue, which sets the effective value without changing the value source.

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.UseSetCurrentValueForMutableProperty

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

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