StaticResource is not found

Hi,

There is a problem, maybe bug, concerning StaticResources in WPF. I use ReSharper 5.1.3000.12 and VS2010 SP1.

I have a project containing common controls, styles and other resources like converters, which are referenced in a ResourceDictionary like this:

GlobalResources.xaml

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <!--Converters-->
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <!--...-->
</ResourceDictionary>

This file is referenced in my App.xaml:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Controls;component/GlobalResources.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>


Now in a second project containing WPF-views I have a reference to the first one and I use the converter instance that is created in the file above:
Example.xaml

...
<Button Content="Cancel" Visibility="{Binding Path=IsExecuting, Converter={StaticResource BooleanToVisibilityConverter}}"/>
...


This compiles and works fine, but ReSharper underlines the reference to "BooleanToVisibilityConverter" with a green curvy line and says "Resource 'BooleanToVisibilityConverter' is not found.".

Is there a way to work around this? And since it compiles well (as expected) and ReSharper doesn't get it, I think it might be a bug..

Thanks, Lucas

1 comment

Hello Lucas,

Such use case is not supported by ReSharper yet. You're welcome to vote for
the following issue: http://youtrack.jetbrains.net/issue/RSRP-225417. Thank
you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi,

There is a problem, maybe bug, concerning StaticResources in WPF. I
use ReSharper 5.1.3000.12 and VS2010 SP1.

I have a project containing common controls, styles and other
resources like converters, which are referenced in a
ResourceDictionary like this:

GlobalResources.xaml

 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
> 
> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
> >  />
> > ]]>

This file is referenced in my App.xaml:

> 
> 
>  Source="/Controls;component/GlobalResources.xaml" />
> 
> 
> ]]>

Now in a second project containing WPF-views I have a reference to the
first one and I use the converter instance that is created in the file
above:

Example.xaml

 
> 
> 
> ..]]>


This compiles and works fine, but ReSharper underlines the reference
to "BooleanToVisibilityConverter" with a green curvy line and says
"Resource 'BooleanToVisibilityConverter' is not found.".

Is there a way to work around this? And since it compiles well (as
expected) and ReSharper doesn't get it, I think it might be a bug..

Thanks, Lucas

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



0

Please sign in to leave a comment.