← All recipes
Moderne licensed

Use the registered routed event handler type

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Wpf.UseRegisteredRoutedEventHandlerTypeArtifactOpenRewrite.Recipes.CSharp.CodeQuality

A handler passed to EventManager.RegisterClassHandler, AddHandler or RemoveHandler must be constructed with the delegate type the RoutedEvent was registered with; WPF rejects any other at run time. Replaces the wrong delegate type with the registered one.

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

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

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