Use nameof() instead of a constant
ProprietaryRegistering 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. UseNameofInsteadOfConstantmod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Wpf. UseNameofInsteadOfConstantInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.