New to Telerik UI for WPFStart a free 30-day trial

How to Change Theme Variation During Runtime

Updated on Sep 15, 2025

Environment

Product Version2020.3.1020
ProductProgress® Telerik® UI for WPF

Description

How to change a theme's variation during runtime.

Solution

To change a theme's variation during runtime and reflect this change in the UI, you need to call the LoadPreset method and reload the required resource dictionaries.

C#
	private void ThemeVariationsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
	{
		var selectedItem = (RadComboBoxItem)e.AddedItems[0];
		var colorVariationName = selectedItem.Content.ToString(); // Light or Dark
		var colorVariation = (FluentPalette.ColorVariation)Enum.Parse(typeof(FluentPalette.ColorVariation), colorVariationName);
		FluentPalette.LoadPreset(colorVariation);
		OnResetTheme();
	}

	private static void OnResetTheme()
	{
		Application.Current.Resources.MergedDictionaries.Clear();
		Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
		{
			Source = new Uri("/Telerik.Windows.Themes.Fluent;component/Themes/System.Windows.xaml", UriKind.RelativeOrAbsolute)
		});
		Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
		{
			Source = new Uri("/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.xaml", UriKind.RelativeOrAbsolute)
		});
		Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
		{
			Source = new Uri("/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Input.xaml", UriKind.RelativeOrAbsolute)
		});

		// add any other required dictionaries
	}

See Also