Using VS 2010 / .Net 4.0, a CA1811 code analysis warning (see below) is triggered in all properties in the ViewModel, even if they are used with XAML binding:
Warning CA1811: Microsoft.Performance: "BackupWindowViewModel.BackupCommand.get ()" does not seem to have open 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 derived from ViewModelBase) from CA1811? To suppress this warning for each individual property is a huge pain.
c # static-analysis mvvm
Mr. Bungle
source share