Use nameof() instead of a constant

Proprietary

Registering a DependencyProperty, RoutedEvent or RoutedCommand with a const string silently breaks when the corresponding member is renamed. Replaces the constant with nameof(...) when the constant's value names a member of the containing type.

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

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