From 46dbb5e78279d0b2033d0e56648e723063e03f1b Mon Sep 17 00:00:00 2001 From: "Andy De George (adegeo)" Date: Fri, 8 Nov 2024 21:52:01 -0800 Subject: [PATCH] minor fixes --- .../net/wpf/whats-new/index.md | 9 +++++---- .../net/wpf/whats-new/net90.md | 18 ++++++++++-------- .../snippets/net90/csharp/MainWindow.xaml | 3 ++- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/dotnet-desktop-guide/net/wpf/whats-new/index.md b/dotnet-desktop-guide/net/wpf/whats-new/index.md index 41243e4c88..96fd5b83e6 100644 --- a/dotnet-desktop-guide/net/wpf/whats-new/index.md +++ b/dotnet-desktop-guide/net/wpf/whats-new/index.md @@ -11,12 +11,13 @@ Each .NET release introduces a new version of Windows Presentation Foundation (W ## .NET 9 -Enhanced support for building modern apps with WPF with several theming enhancements: +More support for building modern apps with WPF with several theming enhancements: - [Overview of WPF on .NET 9](net90.md) -- [ThemeMode API](net90.md#thememode-api) -- [AccentColors as SystemColors](net90.md#accentcolors-as-systemcolors) -- [Hyphen based ligature support](net90.md#hyphen-based-ligature-support) +- [Fluent theme](net90.md#fluent-theme) +- [ThemeMode](net90.md#thememode) +- [Support for Windows accent color](net90.md#support-for-windows-accent-color) +- [Hyphen-based ligature support](net90.md#hyphen-based-ligature-support) ## .NET 8 diff --git a/dotnet-desktop-guide/net/wpf/whats-new/net90.md b/dotnet-desktop-guide/net/wpf/whats-new/net90.md index 93b8969bbb..0db7fe4667 100644 --- a/dotnet-desktop-guide/net/wpf/whats-new/net90.md +++ b/dotnet-desktop-guide/net/wpf/whats-new/net90.md @@ -28,7 +28,7 @@ A new theme is included with WPF that delivers a fresh, modern Windows 11 aesthe ### Apply the theme -You can apply the Fluent theme in two ways. First, you can apply the theme by setting the `ThemeMode` property. For more information, see the [ThemeMode](#thememode) section. Secondly, you can apply the theme by loading the resource dictionary that contains the theme. +You can apply the Fluent theme in two ways, setting the `ThemeMode` property or referencing the Fluent theme resource dictionary. For more information about the theme mode setting, see [ThemeMode](#thememode). The Fluent theme resource dictionary is available at the following pack URI: `/PresentationFramework.Fluent;component/Themes/Fluent.xaml`. To apply the resource at the application-level, load the resource into your app's resources: @@ -42,15 +42,17 @@ The Fluent theme resource dictionary is available at the following pack URI: `/P ``` +The resource dictionary can also be applied to a `Window` to theme just the window itself. + ## ThemeMode -A new styling API has been added to WPF, which is controlled through the `ThemeMode` property. By using this property, you can load the Fluent style without having to apply a styling resource dictionary directly. +A new styling API has been added to WPF, which is exposed through the `ThemeMode` property. By using this property, you can apply the Fluent style without having to reference a styling resource dictionary directly. -Valid values are: +Available values are: - `Light`—Applies the light Fluent theme. - `Dark`—Applies the dark Fluent theme. -- `System`—Applies either the light or dark Fluent theme, based on the current system choice. +- `System`—Applies either the light or dark Fluent theme, based on the user's current Windows setting. - `None`—(default) Uses the Aero2 theme. To apply a theme mode for the whole application, set the `ThemeMode` property on the `Application` type. To apply it to a single window, set `ThemeMode` on the `Window` type. @@ -69,7 +71,7 @@ If the `ThemeMode` is set to any value other than `None` at the application-leve ### Set in code -Support for changing setting the `ThemeMode` in code is currently an experimental feature. Accessing the `ThemeMode` property by code generates error **WPF0001**, preventing access to the API. Suppress the error to access to the API. +Support for changing setting the `ThemeMode` in code is currently an experimental feature. Accessing the `ThemeMode` property in code generates error **WPF0001**, preventing access to the API. Suppress the error to access to the API. > [!WARNING] > This API is experimental and subject to change. @@ -123,14 +125,14 @@ When creating a UI that uses the accent color, wrap the resource key in a dynami :::code language="xaml" source=".\snippets\net90\csharp\MainWindow.xaml" id="DynamicAccent"::: -## Hyphen based ligature support +## Hyphen-based ligature support WPF has never supported hyphen-based ligatures in UI controls such as the `TextBlock`. This long-standing community ask was added in .NET 9. Here's an image of the ligatures not being applied to the glyphs in .NET 8: -:::image type="content" source="./media/net90/ligature-8.png" alt-text="A screenshot of a simple WPF app that has a text block showing how glyphs aren't combined into ligatures."::: +:::image type="content" source="./media/net90/ligature-8.png" alt-text="A screenshot of a simple WPF app that has a text block showing how glyphs aren't combined into ligatures with .NET 8."::: And now, that same text as rendered in .NET 9: -:::image type="content" source="./media/net90/ligature-9.png" alt-text="A screenshot of a simple WPF app that has a text block showing how glyphs aren't combined into ligatures."::: +:::image type="content" source="./media/net90/ligature-9.png" alt-text="A screenshot of a simple WPF app that has a text block showing how glyphs are combined into ligatures with .NET 9."::: diff --git a/dotnet-desktop-guide/net/wpf/whats-new/snippets/net90/csharp/MainWindow.xaml b/dotnet-desktop-guide/net/wpf/whats-new/snippets/net90/csharp/MainWindow.xaml index b77ad04f24..e863438311 100644 --- a/dotnet-desktop-guide/net/wpf/whats-new/snippets/net90/csharp/MainWindow.xaml +++ b/dotnet-desktop-guide/net/wpf/whats-new/snippets/net90/csharp/MainWindow.xaml @@ -19,7 +19,8 @@