Hi,
I am trying to load ResourceDictionary at runtime by adding it to MergedDictionaries. My ResourceDictionaries are defined as follows (see bwlow) - but for some reason I can seem get a reference to it to add to MergedDictionaries. What am I doing wrong?
<ResourceDictionary> <ResourceDictionary x:Key="igThemePivotGrid" x:Name="igThemePivotGrid" Source="Styles/IgTheme/IG.xamPivotGrid.xaml"/> <ResourceDictionary x:Key="office2010BlueThemePivotGrid" x:Name="office2010BlueThemePivotGrid" Source="Styles/OfficeBlueTheme/Office2010Blue.xamPivotGrid.xaml"/> </ResourceDictionary>
Thanks
Sangeetha
Hello,
You have to remove x:Key from the resource dictionary definition.
Plamen.
In code behind, I can do it as follows and it works fine. It would be nice to know how to do it via Xaml designer.
ResourceDictionary dict = new ResourceDictionary();
dict.Source = new Uri("/MarketManipulatorControl;component/Styles/IgTheme/IG.xamPivotGrid.xaml", UriKind.RelativeOrAbsolute);Application.Current.Resources.MergedDictionaries.Add(dict);