Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to use DevExpress themes in a WPF Application

$
0
0

This example demonstrates all common ways of using themes in your application.

DevExpress provides multiple themes that can be applied to all DevExpress WPF controls and some standard controls (GroupBox, ScrollViewer, Scroll, RadioButton, Button, ListBox, Slider, TabControl, Separator, ToggleButton, RepeatButton, Label, ListBoxItem, TabItem, ToolTip, etc.). All built-in themes are described in the following article: DevExpress WPF Themes.

The easiest way to apply a particular theme to the application is to specify the static ThemeManager.ApplicationThemeName property.

To set a theme for a specific element, use the ThemeManager.ThemeName attached property:

 

[XAML]
xmlns:dx=http://schemas.devexpress.com/winfx/2008/xaml/core<TextBoxName="textBox1"dx:ThemeManager.ThemeName="MetropolisLight"Width="120"Height="23"/>

 

In this case, the theme will be applied to the element and all its child elements.

Keep in mind these simple rules when applying DevExpress themes:

1. The ThemeManager.ApplicationThemeName property has lower priority than the ThemeManager.ThemeName property set locally.

2. The ThemeManager.ThemeName property value set for a parent element may be changed for its child if you explicitly specify the ThemeManager.ThemeName property for it.

In some cases, you may need to retrieve a list of all available DevExpress themes. The static Theme.Themes property contains this information.

 


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>