"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


4 comments
Comment actions Permalink

Scott,

Could you provide me with a complete sample, please? Thanks in advance.

0
Comment actions Permalink

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,

>

Could you provide me with a complete sample, please? Thanks in advance.

>

---
Original message URL:
http://www.jetbrains.net/devnet/message/5265083#5265083


0
Comment actions Permalink

Scott,

I cannot see code sample here. Could you mail to me to qx [at] jetbrains [dot] com
Thanks in advance

0
Comment actions Permalink

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>

0

Please sign in to leave a comment.