Reporter | Peter Urda (urda) |
---|---|
Created | Feb 17, 2012 8:56:49 PM |
Updated | Feb 17, 2012 8:56:49 PM |
Priority | Normal |
Type | Bug |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Evgeny Pasynkov (pasynkov) |
Subsystem | Code Analysis - Find Code Issues |
Affected versions | 6.1 |
Fixed in build | No Fixed in build |
I am working on a WPF project (.NET 4.0). I have a custom XAML code snippet that is used for rounding the corners of a TreeView's selection. ReSharper, however, marks the style resource as "redundant" and has a desire to remove it. If one follows ReSharper's advice, they will lose the rounded corners on their selection in the TreeView (or any other similar WPF box that has selections, and can use the following code snippet).
Sample XAML
<GroupBox> <TreeView> <TreeView.Resources> <!-- ... --> </TreeView.Resources> <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="BorderThickness" Value="1.5"/> <Style.Triggers> <!-- ... --> </Style.Triggers> <Style.Resources> <!-- RESHARPER WANTS TO REMOVE THIS! --> <Style TargetType="Border"> <Setter Property="CornerRadius" Value="2"/> </Style> <!-- RESHARPER WANTS TO REMOVE THIS! --> </Style.Resources> </Style> </TreeView.ItemContainerStyle> <TreeView.ItemTemplate> <!-- --> </TreeView.ItemTemplate> </TreeView> </GroupBox>