Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3914
add ResourceDictionary to MergedDictionaries
posted

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

Parents
  • 3914
    posted

    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);

     

    Thanks

    Sangeetha

     

     

Reply Children