VisualStudio2019 Theme

With the R3 2019 release of the UI for WPF suite we have introduced the brand new VisualStudio2019 theme. Inspired by the new refreshed Visual Studio 2019 IDE, the VisualStudio2019 theme delivers a lot cleaner and smoother look and feel to your WPF apps. The team at Microsoft are well known for their eagerness to deliver the best possible user experience that we encounter every day and with the VisualStudio2019 theme you will be able to easily bring it to your own apps.

The following topic explains the specifics of the theme's palette and features.

Default Theme Colors

The VisualStudio2019 Theme is designed to be easily modified via the exposed colors in the theme palette. The default values of the brushes in the theme are listed below.

Brush name Brush value
AccentBrush #F5CC84
AccentDarkBrush #5F6FA4
AccentFocusedBrush #D2A85E
AccentMainBrush #AAC0FF
AccentMouseOverBrush #C4D5FF
AccentSecondaryDarkBrush #40508D
AlternativeBrush #F7F9FE
BasicBrush #94A6CA
ComplementaryBrush #D9E0F8
HeaderBrush #40568D
IconBrush #414141
MainBrush #FCFCFC
MarkerBrush #1E1E1E
MarkerInvertedBrush #FFFFFF
MouseOverBrush #FFF8DF
PrimaryBrush #F2F5FC
ReadOnlyBackgroundBrush #FCFCFC
ReadOnlyBorderBrush #94A6CA
SecondaryBrush #FFFFFF
SemiBasicBrush #C0CAE9
ValidationBrush #FF3333

Figure 1: Theme colors represented in RadOutlookBar

VisualStudio2019 theme colors represented in RadOutlookBar

VisualStudio2019Palette Properties

Primary Brushes

  • PrimaryBrush: Used for background of inputs.
  • MainBrush: Used for background of buttons.
  • AlternativeBrush: Used for background of popups, windows, list boxes etc.
  • BasicBrush: Used in the majority of the normal state borders and for the borders of windows as well.
  • ComplementaryBrush: Slightly darker than the alternative in case of collisions.
  • MarkerBrush: Used for the majority of foregrounds which are black.
  • MarkerInvertedBrush: Used for interaction states - mainly where change of the foreground to white is required.
  • IconBrush: Used for glyph and path icons.

Interaction State Brushes

  • AccentBrush: Used for borders of the hovered states of the elements as well as for backgrounds of toggled/checked buttons.
  • AccentDarkBrush: Used in backgrounds for the pressed states of the elements.
  • AccentFocusedBrush: Variation of the AccentBrush that is used for the focused states of the elements.
  • AccentMainBrush: Used for the selected states of selected elements (e.g. menu items, dropdown items, list box items).
  • AccentMouseOverBrush: Variation of AccentMainBrush that is used for the hovered states of the above mentioned selected elements.
  • AccentSecondaryDarkBrush: Variation of AccentDarkBrush that is used for the foreground of the picker control buttons - DatePicker, DateTimePicker, CalculatorPicker, etc., as well as for the points in the data visualization controls - BulletGraph, Sparkline, etc.
  • MouseOverBrush: Used for background of the hovered states of non-accent elements.

Special Brushes

  • HeaderBrush: A dark blue brush that is used for the background of the header elements.
  • ReadOnlyBackgroundBrush: A white brush that is used for the background of the read only state of the elements.
  • ReadOnlyBorderBrush: A polo blue brush that is used for the border of the read only state of the elements.
  • ValidationBrush:  A bright red brush that is used for indicating validation errors - for the underline of the invalid control and as a border for the error tooltip, border for invalid rows and cells.

Other Properties

  • DisabledOpacity: Used for controls when they are in a disabled state. Backgrounds usually use the ComplementaryBrush when disabled.
  • ReadOnlyOpacity: Used for controls when they are in a read-only state.

Font Family and Font Size

When using the VisualStudio2019 theme you can dynamically change the FontSize and FontFamily properties of all components in the application the same way as you do in Windows8, Windows8Touch, Office2013, VisualStudio2013, Office2016, Green, Material, Fluent and Crystal themes.

The FontSize and FontFamily properties are public so you can easily modify the theme resources at a single point. The most commonly used font size in the theme is with value 12 and can be modified through the VisualStudio2019Palette.Palette.FontSize property in the same manner as in the other themes that support a theme palette.

The default font used in the theme is Segoe UI.

For complex scenarios we strongly recommend setting the FontSize properties only before the application is initialized.

Example 1 shows the default font sizes and families.

Example 1: Default FontSize

VisualStudio2019Palette.Palette.FontSizeXS = 10; 
VisualStudio2019Palette.Palette.FontSizeS = 11; 
VisualStudio2019Palette.Palette.FontSize = 12; 
VisualStudio2019Palette.Palette.FontSizeL = 13; 
VisualStudio2019Palette.Palette.FontSizeXL = 20; 
Example 2 shows how to change the default FontFamily from "Segoe UI" to "Calibri Italic" and the FontSize from 12 to 16.

Example 2: Changing the theme's FontSize and FontFamily

private void OnButtonChangeFontSizeClick(object sender, RoutedEventArgs e) 
{ 
    VisualStudio2019Palette.Palette.FontSize = 16; 
    VisualStudio2019Palette.Palette.FontFamily = new FontFamily("Calibri Italic"); 
} 

Figure 2: Setting FontSize and FontFamily

RadCalendar with modified FontSize and FontFamiliy

Glyphs

The VisualStudio2019 Theme also uses the Telerik Web UI font glyphs by default. The RadGlyph provides a lightweight, flexible and design-time-friendly implementation of our glyph font.

You can read more about the RadGlyph in the RadGlyph Overview article and about the range of the font glyphs in the Font Glyphs Overview article.

Theme Helper

The ThemeHelper class that comes with the R3 2019 release is used in the VisualStudio2019 theme. It exposes a set of attached properties and can be used to directly modify the appearance of a specific basic control without the need to alter its control template.

Example 3 shows a RadToggleButton control with modified brushes for its different states through the ThemeHelper class:

Example 3: Set RadToggleButton's visual appearance through the ThemeHelper class

<telerik:RadToggleButton Content="RadButton"  
                         Margin="10" 
                         xmlns:helpers="clr-namespace:Telerik.Windows.Controls.Theming.Helpers;assembly=Telerik.Windows.Controls" 
                         helpers:ThemeHelper.MouseOverBrush="{telerik:VisualStudio2019Resource ResourceKey=AccentMouseOverBrush}" 
                         helpers:ThemeHelper.PressedBrush="{telerik:VisualStudio2019Resource ResourceKey=ValidationBrush}" 
                         helpers:ThemeHelper.CheckedBrush="{telerik:VisualStudio2019Resource ResourceKey=AccentMainBrush}"/> 

Figure 3: Appearance of the RadToggleButton in the different states

RadToggleButton States

Changing Opacity

If you need to change the opacity of the disabled and read-only elements, you can easily do so by using the DisabledOpacity and ReadOnlyOpacity properties of the VisualStudio2019Palette. The default values are 0.3 and 0.6 respectively.

Example 4: Changing the opacity

VisualStudio2019Palette.Palette.DisabledOpacity = 0.5; 
VisualStudio2019Palette.Palette.ReadOnlyOpacity = 0.5; 
VisualStudio2019Palette.Palette.DisabledOpacity = 0.5 
VisualStudio2019Palette.Palette.ReadOnlyOpacity = 0.5 

See Also

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