Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Silverlight : Changing theme at run-time

Silverlight : Changing theme at run-time

Scheduled Pinned Locked Moved WPF
wpfcsharptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Prasoon Chaudhary
    wrote on last edited by
    #1

    How do we change theme for a silverlight application at run-time. Suppose I have "Theme1.xaml", "Theme2.xaml" and "Theme3.xaml" as themes inside 'Themes' folder, and I wish to apply them on button-click or combobox-selection. In WPF, I used to get the required result with following code -

    ResourceDictionary skin = new ResourceDictionary();
    //themeName is string type var, which contains name of selected theme
    skin.Source = new Uri(@"Themes/" + themeName + ".xaml", UriKind.Relative);
    Application.Current.Resources.MergedDictionaries.Clear();
    Application.Current.Resources.MergedDictionaries.Add(skin);

    But for Silverlight, I'm not sure how to do it. Any idea? Please do not provide link with 'Telerik' content. I have seen it already.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups