Disable "Unused member" inspection on certain types within XAML

I am using VS 2010 SP1 with ReSharper 7.1.2.

Our team created a WPF control that we assign an x:Name to, but we don't reference the control by name directly.  The name is used via reflection for saving some UI layout preferences.  The ReSharper warning "Type or type member is never used" obviously flags these.  I'd like to suppress thios inspection for all usges of this particular type, without needed to add a comment for each one.  For instance, if I have

<StackPanel x:Name="Panel">
     <!-- This control is not referenced directly by name, but the name is used via reflection for some UI preferences -->
     <my:CustomCtrl x:Name="Unused1">
          <TextBlock x:Name="MyText" />
          <Button x:Name="MyButton" />
     </my:CustomCtrl x:Name="Unused1">
     <!-- Repeat 20 or so times with various nesting levels -->
</StackPanel x:Name="Panel">

I would like to globally suppress the "Type of type member is never used" inspection for all usages of my:CustomCtrl.  I'd prefer not to litter my code with a bunch of suppression comments.


Please sign in to leave a comment.