← All recipes
Moderne licensed

Add ValueConversion attribute

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Wpf.AddValueConversionAttributeArtifactOpenRewrite.Recipes.CSharp.CodeQuality

An IValueConverter should be annotated with [ValueConversion(typeof(source), typeof(target))] so XAML tooling knows the types it converts between. Adds the attribute when both types can be determined from Convert.

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

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

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