Cast the sender of a dependency property callback to the correct type

Proprietary

The DependencyObject passed to a PropertyChangedCallback or CoerceValueCallback is the type that registered the property. Replaces a cast, as, is or case conversion naming a type the sender can never be with the registering type.

OpenRewrite.Recipes.CSharp.CodeQuality.Wpf.CastSenderToCorrectType
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Wpf.CastSenderToCorrectType

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.