Unused styles in resources are not detected

Hello. I have the following Silverlight 3 User Control and I am using R# 5 with Visual Studio 2008 SP1:



    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:FinancialApps_Client_WCFService="clr-namespace:FinancialApps.Client.WCFService" x:Class="FinancialApps.Client.Views.PublicationManager.MagazinesUC"




        <DataTemplate x:Key="ItemTemplate">


                <TextBlock Text="{Binding Name}" />



        <Style x:Key="CheckBoxItemContainerStyle" TargetType="ListBoxItem">





    <Grid x:Name="LayoutRoot" Background="White">

        <ListBox x:Name="magazinesListBox" MinHeight="250" MinWidth="250">



                    <CheckBox IsChecked="{Binding Checked, Mode=TwoWay}" Content="{Binding Name}" />





        <!-- <ListBox x:Name="magazinesListBox" ItemTemplate="{StaticResource ItemTemplate}" ItemContainerStyle="{StaticResource CheckBoxItemContainerStyle}"  SelectionMode="Extended"  MinWidth="250" MinHeight="250"/>  -->




ReSharper correctly identifies that the resource "ItemTemplate" is not being used and marks it with the light gray color and it can be removed using the action list. ReSharper however does not detect that the style "CheckBoxItemContainerStyle" is unused as well and that it can be removed too.

Comment actions Permalink

it might affect performance significantly if we check control types against styles' target types. So we decided to leave such styles unchecked.

Comment actions Permalink

Even if you would only check the resources declared in the user control?

Comment actions Permalink

In fact, it might take time. I'll try to do my best.

Comment actions Permalink

I think, I've implemented the highlighting properly. Try the tomorrow's nightly, please.


Please sign in to leave a comment.