Skip to content

Commit 60b901f

Browse files
authored
Merge pull request #1587 from MicrosoftDocs/chigy/style
Update style section to talk about the knob to utilize previous version
2 parents 967bf58 + d293d1c commit 60b901f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

windows-apps-src/design/controls-and-patterns/xaml-styles.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ ms.localizationpriority: medium
1919

2020
You can customize the appearance of your apps in many ways by using the XAML framework. Styles let you set control properties and reuse those settings for a consistent appearance across multiple controls.
2121

22+
## WinUI and styles
23+
24+
Starting with WinUI 2.2, we have used the [Windows UI Library](/windows/apps/winui/) (WinUI) to deliver new visual style updates across our UI components. If you notice your UI is not updating to the latest styles, be sure to update to the latest WinUI NuGet package.
25+
26+
Starting with WinUI 2.6, we provide new styles for most of the controls, and a new versioning system that let's you revert to the previous control styles if needed. We encourage you to use the new styles, as they better match the design direction of Windows. However, if your scenario cannot support the new styles, the previous versions are still available.
27+
28+
You can change the style version by setting the `ControlsResourcesVersion` property on the `XamlControlsResources` that you include in your `Application.Resources` when you use WinUI version 2. `ControlsResourcesVersion` defaults to the enum value `Version2`.
29+
30+
Setting this value to `Version1` causes `XamlControlsResources` to load the previous style versions instead of the new styles used by the latest WinUI version. Changing this property at runtime is not supported and VisualStudio's hot reload functionality will not work; however, after you rebuild your application you will see the control styles change.
31+
32+
```xaml
33+
<Application.Resources>
34+
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"
35+
ControlsResourcesVersion="Version1"/>
36+
</Application.Resources>
37+
```
38+
2239
## Style basics
2340

2441
Use styles to extract visual property settings into reusable resources. Here's an example that shows 3 buttons with a style that sets the [BorderBrush](/uwp/api/windows.ui.xaml.controls.control.borderbrush), [BorderThickness](/uwp/api/windows.ui.xaml.controls.control.borderthickness) and [Foreground](/uwp/api/windows.ui.xaml.controls.control.foreground) properties. By applying a style, you can make the controls appear the same without having to set these properties on each control separately.
@@ -202,4 +219,4 @@ You should use the styles that come from the Windows Runtime default XAML resour
202219

203220
## The template property
204221

205-
A style setter can be used for the [Template](/uwp/api/windows.ui.xaml.controls.control.template) property of a [Control](/uwp/api/Windows.UI.Xaml.Controls.Control), and in fact this makes up the majority of a typical XAML style and an app's XAML resources. This is discussed in more detail in the topic [Control templates](control-templates.md).
222+
A style setter can be used for the [Template](/uwp/api/windows.ui.xaml.controls.control.template) property of a [Control](/uwp/api/Windows.UI.Xaml.Controls.Control), and in fact this makes up the majority of a typical XAML style and an app's XAML resources. This is discussed in more detail in the topic [Control templates](control-templates.md).

windows-apps-src/design/style/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ms.custom: RS5
1414

1515
Style is what makes your app stand out. The style guidelines in this section help you create a Fluent Design through color, typography, and new features such as acrylic material and reveal highlight.
1616

17+
We use the [Windows UI Library](/windows/apps/winui/) (WinUI) to deliver the latest styles across our UI components. Be sure to use the latest WinUI version to keep your apps up-to-date with the current Windows app Fluent styles. For more info about how to do this, see [XAML styles](../controls-and-patterns/xaml-styles.md).
18+
1719
:::row:::
1820
:::column:::
1921
![Image depicting a color gradient.](images/header-color.svg)

0 commit comments

Comments
 (0)