Silverlight : Changing theme at run-time
WPF
1
Posts
1
Posters
0
Views
1
Watching
-
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.