You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: styling-and-appearance/theme-helper.md
+26-14
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Theme Helper
3
3
page_title: Theme Helper
4
-
description: The UI for {{ site.framework_name }} suite comes with a theming helper class which you can use to bring the theming of your application to a next level.
4
+
description: The UI for WPF suite comes with a theming helper class which you can use to bring the theming of your application to a next level.
5
5
slug: styling-appearance-theme-helper
6
6
tags: theming,theme,helper
7
7
published: True
@@ -10,17 +10,28 @@ position: 5
10
10
11
11
# Theme Helper
12
12
13
-
The **Theme Helper** enables you to directly modify the appearance of a specific basic control without the need to alter its control template. The class contains the following list of dependency properties, which can be set directly in XAML for each of the themes:
13
+
The `ThemeHelper` class allows you to directly modify the appearance of a specific basic control without the need to alter its control template.
14
14
15
-
***MouseOverBrush**: Can be used to set the value of the background/border Brush applied when the mouse is over the control.
16
-
***PressedBrush**: Can be used to set the value of the background/border Brush applied when the control is pressed.
17
-
***CheckedBrush**: Can be used to set the value of the background/border Brush applied when the element is in Checked state. It will have effect when used on elements that expose a "checked" state (ToggleButton, RadListBoxItem, etc.)
18
-
***FocusBrush**: Can be used to set the value of the background/border Brush applied when the element is focused.
19
-
***ReadOnlyBrush**: Can be used to set the value of the background/border Brush applied when the control is in its read-only state (if such is available for it).
20
-
***DisabledBrush**: Can be used to set the value of the background/border Brush applied when the control is in its disabled state.
21
-
***CornerRadius**: Can be used to set the corner radius of commonly used basic controls that could need corner radius customizations but don't expose such property by default (e.g. Button, RepeatButton, ListBox, RadComboBox, etc.)
15
+
The class contains the following list of dependency properties, which can be set directly in XAML:
22
16
23
-
> The ThemeHelper class currently works out-of-the-box with the **VisualStudio2019**, **Crystal**, **Fluent**, **Material** themes. Please note that not all properties will work for any given control at the moment. To see which properties are fully supported for a specific control, please check its [ControlTemplate]({%slug styling-apperance-editing-control-templates%}).
17
+
*`MouseOverBrush`—Can be used to set the value of the border Brush applied when the mouse is over the control.
18
+
*`MouseOverBackgroundBrush`—Can be used to set the value of the background Brush applied when the mouse is over the control.
19
+
*`PressedBrush`—Can be used to set the value of the border Brush applied when the control is pressed.
20
+
*`PressedBackgroundBrush`—Can be used to set the value of the background Brush applied when the control is pressed.
21
+
*`CheckedBrush`—Can be used to set the value of the border Brush applied when the element is in Checked state. It will have effect when used on elements that expose a "checked" state (ToggleButton, RadListBoxItem, etc.)
22
+
*`CheckedBackgroundBrush`—Can be used to set the value of the background Brush applied when the element is in Checked state.
23
+
*`FocusBrush`—Can be used to set the value of the border Brush applied when the element is focused.
24
+
*`FocusBackgroundBrush`—Can be used to set the value of the background Brush applied when the element is focused.
25
+
*`ReadOnlyBrush`—Can be used to set the value of the border Brush applied when the control is in its read-only state (if such is available for it).
26
+
*`ReadOnlyBackgroundBrush`—Can be used to set the value of the background Brush applied when the control is in its read-only state (if such is available for it).
27
+
*`DisabledBrush`—Can be used to set the value of the border Brush applied when the control is in its disabled state.
28
+
*`DisabledForegroundBrush`—Can be used to set the value of the foreground Brush applied when the control is in its disabled state.
29
+
*`DisabledBackgroundBrush`—Can be used to set the value of the background Brush applied when the control is in its disabled state.
30
+
*`ScrollBarsMode`—Can be used to set the mode of the scrollbars of a ScrollViewer. This mode takes effect for themes like Fluent and Crystal, which by design have thin scrollbars that expand their size on MouseOver.
31
+
*`FocusVisualMargin`—Sets a margin for the focus visual element.
32
+
*`CornerRadius`—Can be used to set the corner radius of commonly used basic controls that could need corner radius customizations but don't expose such property by default (e.g. Button, RepeatButton, ListBox, RadComboBox, etc.)
33
+
34
+
>important The ThemeHelper class currently works out-of-the-box with the __Windows 11__, __Office2019__, __VisualStudio2019__, __Crystal__, __Fluent__, and __Material__ themes. Please note that not all properties will work for any given control at the moment. To see which properties are fully supported for a specific control, please check its [ControlTemplate]({%slug styling-apperance-editing-control-templates%}).
24
35
25
36
## How to Use the Theme Helper?
26
37
@@ -30,14 +41,14 @@ It only takes a few simple steps:
30
41
* Set any of the above listed properties directly to the desired control.
31
42
* If you need to apply it to a several (or a lot of) control instances, we recommend creating implicit styles.
32
43
33
-
The next examples show how to apply these steps to modify the brushes for the different states of a **RadToggleButton** through the **ThemeHelper** class:
44
+
The next examples show how to apply these steps to modify the brushes for the different states of a `RadToggleButton` through the ThemeHelper class:
34
45
35
-
#### __[XAML]Example 1: Declare a SolidColorBrush to use as a StaticResource__
46
+
#### __[XAML] Declare a SolidColorBrush to use as a StaticResource__
0 commit comments