Use nameof() instead of a string literal

Proprietary

Registering a DependencyProperty, RoutedEvent or RoutedCommand with a string literal silently breaks when the corresponding member is renamed. Replaces the literal with nameof(...) when a member of that name exists on the containing type.

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

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