← All recipes
Moderne licensed

Cast the value of a dependency property callback to the correct type

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Wpf.CastValueToCorrectTypeArtifactOpenRewrite.Recipes.CSharp.CodeQuality

The value a PropertyChangedCallback, CoerceValueCallback or ValidateValueCallback receives is the type the property was registered with. Replaces a cast, as, is or case conversion naming a type the value can never be with the registered type.

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

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

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