I saw a demo on how to dynamically change a single control bound to a combobox, something like this:
telerik:StyleManager.Theme="{Binding SelectedValue, ElementName=themesBox}
That's all well and good, but I want to change the theme site-wide via the combobox. So I tried doing this in the MasterPage, again, bound to the ComboBox:
private void Theme_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
switch (Theme.SelectedItem.ToString())
{
case "Office Blue":
StyleManager.ApplicationTheme = new Office_BlueTheme();
break;
case "Office Black":
StyleManager.ApplicationTheme = new Office_BlackTheme();
break;
case "Office Silver":
StyleManager.ApplicationTheme = new Office_SilverTheme();
break;
case "Vista":
StyleManager.ApplicationTheme = new VistaTheme();
break;
case "Summer":
StyleManager.ApplicationTheme = new SummerTheme();
break;
case "Windows 7":
StyleManager.ApplicationTheme = new Windows7Theme();
break;
}
}
}
However, nothing changes when select a new setting. Is there something else I need to call in order to make the change "take"?
telerik:StyleManager.Theme="{Binding SelectedValue, ElementName=themesBox}
That's all well and good, but I want to change the theme site-wide via the combobox. So I tried doing this in the MasterPage, again, bound to the ComboBox:
private void Theme_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
switch (Theme.SelectedItem.ToString())
{
case "Office Blue":
StyleManager.ApplicationTheme = new Office_BlueTheme();
break;
case "Office Black":
StyleManager.ApplicationTheme = new Office_BlackTheme();
break;
case "Office Silver":
StyleManager.ApplicationTheme = new Office_SilverTheme();
break;
case "Vista":
StyleManager.ApplicationTheme = new VistaTheme();
break;
case "Summer":
StyleManager.ApplicationTheme = new SummerTheme();
break;
case "Windows 7":
StyleManager.ApplicationTheme = new Windows7Theme();
break;
}
}
}
However, nothing changes when select a new setting. Is there something else I need to call in order to make the change "take"?