Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing resources in referenced assemby
Message
From
22/10/2009 06:45:51
 
 
To
All
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Accessing resources in referenced assemby
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01430576
Message ID:
01430576
Views:
69
Hi,
Here's my resource dictionary for the main application:
ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <!--<ResourceDictionary Source="TreeView Resources/StdDataTemplates.xaml"/>
        <ResourceDictionary Source="TreeView Resources/StdTreeViewItemStyle.xaml"/>-->
        <ResourceDictionary Source="pack://application:,,,/GlobalResources;component/Themes/generic.xaml" />
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
This is in the constructor of a class in an assembly referenced by the main assembly:
Style style = (Style)Application.Current.FindResource("StdTreeViewItemStyle");
This works fine at runtime. At design time it doesn't find the resource when using the GlobalResources assemblies resources (but does work if I use the commented version - i.e. additional dictionaries in the main app).
Is there a syntax for the FindResource() that *will* work?
TIA,
Viv
Reply
Map
View

Click here to load this message in the networking platform