Topic | Value |
---|---|
Id | WPF0150 |
Severity | Warning |
Enabled | True |
Category | WpfAnalyzers.Correctness |
Code | AttributeAnalyzer |
RegistrationAnalyzer | |
RoutedCommandCreationAnalyzer | |
RoutedEventBackingFieldOrPropertyAnalyzer |
Use nameof() as it is less fragile than string literal.
ADD MOTIVATION HERE
ADD HOW TO FIX VIOLATIONS HERE
Configure the severity per project, for more info see MSDN.
#pragma warning disable WPF0150 // Use nameof() instead of literal.
Code violating the rule here
#pragma warning restore WPF0150 // Use nameof() instead of literal.
Or put this at the top of the file to disable all instances.
#pragma warning disable WPF0150 // Use nameof() instead of literal.
[System.Diagnostics.CodeAnalysis.SuppressMessage("WpfAnalyzers.Correctness",
"WPF0150:Use nameof() instead of literal.",
Justification = "Reason...")]