← All recipes
Moderne licensed

Add MarkupExtensionReturnType attribute

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Wpf.AddMarkupExtensionReturnTypeAttributeArtifactOpenRewrite.Recipes.CSharp.CodeQuality

A MarkupExtension that overrides ProvideValue should be annotated with [MarkupExtensionReturnType(typeof(T))] so XAML tooling knows what the extension yields. Adds the attribute when the returned type can be determined from ProvideValue.

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

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

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