diff --git a/docs/user-interface/system-theme-changes.md b/docs/user-interface/system-theme-changes.md index 11c71cdf9..572398a2b 100644 --- a/docs/user-interface/system-theme-changes.md +++ b/docs/user-interface/system-theme-changes.md @@ -53,7 +53,7 @@ The following XAML example shows how to use the [`AppThemeBinding`](xref:Microso In this example, the text color of the first is set to green when the device is using its light theme, and is set to red when the device is using its dark theme. Similarly, the displays a different image file based upon the current system theme. -In addition, resources defined in a can be consumed with the [`StaticResource`](xref:Microsoft.Maui.Controls.Xaml.StaticResourceExtension) markup extension: +Resources defined in a can be consumed in an [`AppThemeBinding`](xref:Microsoft.Maui.Controls.Xaml.AppThemeBindingExtension) with the [`StaticResource`](xref:Microsoft.Maui.Controls.Xaml.StaticResourceExtension) markup extension: ```xaml @@ -86,6 +86,29 @@ In addition, resources defined in a and the style changes based on whether the device is using its light theme or dark theme. +::: moniker range=">=net-maui-8.0" + +In addition, resources defined in a can also be consumed in an [`AppThemeBinding`](xref:Microsoft.Maui.Controls.Xaml.AppThemeBindingExtension) with the [`DynamicResource`](xref:Microsoft.Maui.Controls.Xaml.DynamicResourceExtension) markup extension: + +```xaml + + + DarkGray + HotPink + Yellow + + + +``` + +::: moniker-end + ### Extension methods .NET MAUI includes `SetAppThemeColor` and `SetAppTheme` extension methods that enable objects to respond to system theme changes. diff --git a/docs/whats-new/dotnet-8.md b/docs/whats-new/dotnet-8.md index 304c9d5e8..5be9bf526 100644 --- a/docs/whats-new/dotnet-8.md +++ b/docs/whats-new/dotnet-8.md @@ -24,6 +24,7 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c - The position at which a drag or drop gesture occurred can be obtained by calling the `GetPosition` method on a , , or object. For more information, see [Recognize a drag and drop gesture](~/fundamentals/gestures/drag-and-drop.md). - gains a `UserAgent` property. For more information, see [WebView](~/user-interface/controls/webview.md). - Inline media playback of HTML5 video, including autoplay and picture in picture, has been enabled by default for the on iOS. For more information, see [Set media playback preferences on iOS and Mac Catalyst](~/user-interface/controls/webview.md#set-media-playback-preferences-on-ios-and-mac-catalyst). +- Reources defined in a can also be consumed in an [`AppThemeBinding`](xref:Microsoft.Maui.Controls.Xaml.AppThemeBindingExtension) with the [`DynamicResource`](xref:Microsoft.Maui.Controls.Xaml.DynamicResourceExtension) markup extension. For more information, see [Define and consume theme resources](~/user-interface/system-theme-changes.md#define-and-consume-theme-resources). The following types or members have been deprecated: