Using VS 2010/.Net 4.0, Code Analysis warning CA1811 (see below) is fired on all properties in a ViewModel even through they are used via XAML binding:
Warning CA1811 : Microsoft.Performance : 'BackupWindowViewModel.BackupCommand.get()' appears to have no upstream public or protected callers.
public ICommand BackupCommand { get { return _backupCommand; } } <--- CA1811
<Button Content="Backup" Command="{Binding BackupCommand}" />
This is because Code Analysis (currently) does not parse XAML. My question is, is there a way to exclude all properties in all ViewModels (e.g. classes deriving from ViewModelBase) from CA1811? Having to suppress this warning on each individual property is a huge pain.
/nowarn:1811
http://msdn.microsoft.com/en-us/library/7f28x9z3%28v=VS.100%29.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With