← All recipes
Moderne licensed

Add default field to converter

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Wpf.AddDefaultFieldToValueConverterArtifactOpenRewrite.Recipes.CSharp.CodeQuality

A stateless IValueConverter or IMultiValueConverter should expose a Default instance rather than being constructed per binding. Adds static readonly T Default = new T(); and seals the converter.

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

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

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