New to Telerik UI for WPF? Download free 30-day trial

How to Set Theme's Color Variation in Design Time

Environment

Product Version 2016.2 613
Product Telerik UI for WPF

Description

How to set a theme's color variation in Visual Studio's designer.

Solution

Visual Studio will run code for designer use if you have enabled the Project Code setting in the designer and have set the theme variant:

  • Before the InitializeComponent() invocation - for a UserControl
  • In the static constructor - for a custom control

static MainWindow() 
{ 
    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Dark); 
} 
Shared Sub New() 
    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Dark) 
End Sub 

Please make sure to clean, rebuild and run the project before reloading the designer for the changes to take effect.

See Also

In this article
Not finding the help you need? Improve this article