← All recipes
Moderne licensed

Add [AttachedPropertyBrowsableForType]

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Wpf.AddAttachedPropertyBrowsableForTypeAttributeArtifactOpenRewrite.Recipes.CSharp.CodeQuality

The static Get accessor of an attached property should be annotated with [AttachedPropertyBrowsableForType(typeof(T))] so the XAML designer offers the property on elements of type T. Adds the attribute naming the accessor's parameter 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.AddAttachedPropertyBrowsableForTypeAttribute

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

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