Welcome to the Xceed Community | Help
Community Search  
More Search Options

Changing to Xceed theme dynamically

Sort Posts: Previous Next
  •  11-22-2011, 3:20 AM Post no. 31357

    Changing to Xceed theme dynamically

    Say, I want to change from theme 'default' to theme 'XceedMedia' dynamically. What will be code-behind for that.

     

    Let's say,

    Dll name is dllName

    The inside theme name I wish to use is - themeName

    And it is inside 'Themes' folder besides Project.

     

    Following works fine for me - 

    ResourceDictionary skin = new ResourceDictionary();

    skin.Source = new Uri(@"/dllName;component/" + themeName + ".xaml", UriKind.Relative);

    Application app = Application.Current;

    app.Resources.MergedDictionaries.Clear();

    app.Resources.MergedDictionaries.Add(skin);

     

    Could you please help for the same with Xceed Media Theme?

  •  11-22-2011, 4:51 AM Post no. 31358 in reply to 31357

    Re: Changing to Xceed theme dynamically

    Got the solution. Just thought to post, in case someone needs exactly the same which I do -

    namespace mapping

    using Xceed.Wpf.Themes;

    using Xceed.Wpf.Themes.Glass;

    In code -

    if (themeName == "glass")

    {

    GlassResourceDictionary xceedSkin = new GlassResourceDictionary();

    xceedSkin.LicenseKey = "Write license key here";

    ..

    ..

    app.Resources.MergedDictionaries.Add(RD);

    }

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.