Set dark theme and color variations

To set a theme and color variation with the telerik components, the following code can be used:

VisualStudio2019Palette.LoadPreset(VisualStudio2019Palette.ColorVariation.Blue);
StyleManager.ApplicationTheme = new VisualStudio2019Theme();

This code uses the VisualStudio theme. To apply the theme to standard controls the Telerik themes must be added to the App.xaml.

<Application x:Class="KeyGenerator.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/System.Windows.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>

To get this working you have to add the Theme.dll to the project references:



Datenschutzerklärung | Impressum