title | description | page_title | type | slug | position | tags | res_type | ticketid |
---|---|---|---|---|---|---|---|---|
Themes Brushes Intellisense |
This article will show you how to add intellisense when using the brushes of the themes in XAML. |
Intellisense when Using the Themes' Brushes |
how-to |
kb-common-theme-brushes-intellisense |
0 |
intellisense, theme, brushes, themes |
kb |
1647230 |
When using {Theme_Name}Resources in XAML, for example, Windows11Resources
, there will be no intellisense to suggest brushes.
You can create a new ResourceDictionary file that will contain SolidColorBrush
instances pointing to the {Theme_Name}Palette.Palette
's properties. Then, merge the created ResourceDictionary.
The following example will use some of the colors of the Windows 11 theme and the properties exposed by the Windows11Palette
object.
tip To view the full list of the default colors for the theme you use, check its [Default Theme Colors]({%slug common-styling-appearance-windows11-theme%}#default-theme-colors) section.
{{region kb-common-theme-brushes-intellisense-0}} {{endregion}}
{{region kb-common-theme-brushes-intellisense-1}} <Application.Resources> </Application.Resources> {{endregion}}
Visual Studio suggesting the colors from the Windows 11 theme