The only exception is the ResourceKey not found exception. 

 

I checked in Reflector and the resources are in the .g.resources file.

 

I thought about the resources dependency and I think I looked there, but I
will have another look tomorrow and get back to you.

 

T.

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Miguel Madero
Sent: Wednesday, 28 July 2010 4:38 PM
To: ozSilverlight
Subject: Re: ResourceDictionary cannot find key

 

Not sure how the Telerik Theme's work, but I think the issue might be in
another place. 

 

Do you an internal exception? 

Could you share the code inside GridView.xaml? I'm thinking it might have
another dependency. 

Could you check in Reflector that you actual have the resource in the
expected location? It should be inside AssemblyName.g.resources with the key
themes/Telerik.Windows.Controls.GridView.xaml

 

 

 

 

On Wed, Jul 28, 2010 at 2:29 PM, <[email protected]> wrote:

Hi all,

I am having trouble with a ResourceDictionary that contains
MergedDictionaries.

Basically, I am attempting to create a theme for Telerik controls, however
that should be irrelevant
as the problem is with ResourceDictionary.

I copied in all the theme information from one of their sample themes into
an external assembly
that I have referenced from within my project.

All the xaml files have their Build Action set to Resource.

The theme project has a class in it with the theme name and the BuiltIn
attribute set, as follows:
[ThemeLocation(ThemeLocation.BuiltIn)]
public class AcmeDefaultTheme : Telerik.Windows.Controls.Theme
{
   public AcmeDefaultTheme()
   {
       //the following line is actually ignored because of the BuiltIn
attribute
       //above!
       this.Source = new
Uri("/Acme.RadControls.Theme;component/themes/Generic.xaml",
UriKind.Relative);
   }
}

I have added the namespace to the xaml of the page where I want to use the
theme:
xmlns:brightstarTheme="clr-
namespace:Acme.RadControls.Theme;assembly=Acme.RadControls.Theme"

I have made a reference to the theme in the resources section.
Firstly like this:
<telerik:Theme x:Key="AcmeDefaultTheme"
Source="/Acme.RadControls.Theme;component/Themes/Telerik.Windows.Controls.Gr
idView.xaml"
/>
and secondly I tried this:
<acmeTheme:AcmeDefaultTheme x:Key="AcmeDefaultTheme" />

In the grid tag, I have added the style:
<telerik:RadGridView x:Name="grdProducts" ItemsSource="{Binding
PagedItemList, Source=
{StaticResource PFOViewModel}}" IsFilteringAllowed="True"
AutoGenerateColumns="False"
FrozenColumnCount="6" Grid.Row="4" Grid.Column="0" AutoExpandGroups="True"
ShowGroupPanel="False"
telerik:StyleManager.Theme="{StaticResource AcmeDefaultTheme}"
>

Everything compiles ok, however when I run the application, I get the
following error:
Failed to assign to property 'System.Windows.ResourceDictionary.Source'...
with the more detailed error of:
A
ResourceDictionary
'/Acme.RadControls.Theme;component/Themes/Telerik.Windows.Controls.Grid
View.xaml'
cannot be found. Please make sure that references to the needed theme
assemblies have been
added to the project.

The problem is that this xaml resources file DOES exist at the location
specified.

Any ideas what I might be doing wrong?

Regards,
Tony

_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight




-- 
Miguel A. Madero Reyes
www.miguelmadero.com (blog)
[email protected]

_______________________________________________
ozsilverlight mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to