Skip to content

Commit d3923a7

Browse files
ThemeHelper: Document non-documented API
1 parent d01d02b commit d3923a7

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

styling-and-appearance/theme-helper.md

+26-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Theme Helper
33
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.
55
slug: styling-appearance-theme-helper
66
tags: theming,theme,helper
77
published: True
@@ -10,17 +10,28 @@ position: 5
1010

1111
# Theme Helper
1212

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.
1414

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:
2216

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%}).
2435
2536
## How to Use the Theme Helper?
2637

@@ -30,14 +41,14 @@ It only takes a few simple steps:
3041
* Set any of the above listed properties directly to the desired control.
3142
* If you need to apply it to a several (or a lot of) control instances, we recommend creating implicit styles.
3243

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:
3445

35-
#### __[XAML] Example 1: Declare a SolidColorBrush to use as a StaticResource__
46+
#### __[XAML] Declare a SolidColorBrush to use as a StaticResource__
3647
{{region styling-appearance-theme-helper-1}}
3748
<SolidColorBrush x:Key="MyCheckedBrush" Color="#FFFF86B1"/>
3849
{{endregion}}
3950

40-
#### __[XAML] Example 2: Set RadToggleButton's visual appearance through the ThemeHelper class__
51+
#### __[XAML] Set RadToggleButton's visual appearance through the ThemeHelper class__
4152
{{region styling-appearance-theme-helper-2}}
4253
<telerik:RadToggleButton Content="RadButton"
4354
Margin="10"
@@ -47,7 +58,8 @@ The next examples show how to apply these steps to modify the brushes for the di
4758
helpers:ThemeHelper.CheckedBrush="{StaticResource MyCheckedBrush}"/>
4859
{{endregion}}
4960

50-
#### **Figure 1: Appearance of the RadToggleButton in the different states**
61+
__Appearance of the RadToggleButton in the different states__
62+
5163
![RadToggleButton States](/styling-and-appearance/images/styling-appearance-theme-helper-toggle-button-states.png)
5264

5365
## See Also

0 commit comments

Comments
 (0)