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.GridView.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