"Remove redundant resource" warning in Xaml misfires when key-less TargetType used
Given Xaml that looks something like this...
...the style shows as grayed out and has a tip on it suggesting removal as a
redundant resource.
The thing is, the resource is in use, because when x:Key is not supplied on
a resource, the style is used as a default for all subelements matching the
TargetType.
Expected: this warning should check for when x:Key is missing and either
look for matches with TargetType, or not warn at all.
This is with build #5.1.1705.5 but was in the release 5.0 as well.
Scott
Please sign in to leave a comment.
Scott,
Could you provide me with a complete sample, please? Thanks in advance.
Sure. Generate a new WPF Application in VS2010 and put this in
MainWindow.xaml:
wrote in message
news:3684240.159801276074867062.JavaMail.clearspace@app8.labs.intellij.net...
>
>
Scott,
I cannot see code sample here. Could you mail to me to qx [at] jetbrains [dot] com
Thanks in advance
Here's the XML that didn't come through in the newsrc post.
<Window x:Class="WpfApplication7.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<Style TargetType="ListBox"/>
</Window.Resources>
<Grid>
<ListBox/>
</Grid>
</Window>