Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update theming.md #2515

Merged
merged 2 commits into from
Oct 1, 2024
Merged

Update theming.md #2515

merged 2 commits into from
Oct 1, 2024

Conversation

thimanshu1993
Copy link
Contributor

Improved notes for better understanding and fixed an open issue.
See issue: #2348

Improved notes for better understanding and fixed an open issue.
Copy link
Contributor

@davidbritch davidbritch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidbritch davidbritch merged commit 73a9c9e into dotnet:main Oct 1, 2024
4 checks passed
@@ -18,14 +18,14 @@ The process for implementing runtime theming in a .NET MAUI app is as follows:
1. Add code to load a theme at runtime. For more information, see [Load a theme at runtime](#load-a-theme-at-runtime).

> [!IMPORTANT]
> Use the [`StaticResource`](xref:Microsoft.Maui.Controls.Xaml.StaticResourceExtension) markup extension if your app doesn’t need to change themes dynamically at runtime. This approach resolves resources at load time, making it more efficient for static themes. However, if you anticipate switching themes (e.g., between light and dark modes) while the app is running, use [`DynamicResource`](xref:Microsoft.Maui.Controls.Xaml.DynamicResourceExtension), which allows resources to update during runtime.
> Use the [`StaticResource`](xref:Microsoft.Maui.Controls.Xaml.StaticResourceExtension) markup extension if your app doesn’t need to change themes dynamically at runtime. If you anticipate switching themes while the app is running, use the [`DynamicResource`](xref:Microsoft.Maui.Controls.Xaml.DynamicResourceExtension) markup extension, which enables resources to be updated at runtime.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> Use the [`StaticResource`](xref:Microsoft.Maui.Controls.Xaml.StaticResourceExtension) markup extension if your app doesnt need to change themes dynamically at runtime. If you anticipate switching themes while the app is running, use the [`DynamicResource`](xref:Microsoft.Maui.Controls.Xaml.DynamicResourceExtension) markup extension, which enables resources to be updated at runtime.
> Use the [`StaticResource`](xref:Microsoft.Maui.Controls.Xaml.StaticResourceExtension) markup extension if your app doesn't need to change themes dynamically at runtime. If you anticipate switching themes while the app is running, use the [`DynamicResource`](xref:Microsoft.Maui.Controls.Xaml.DynamicResourceExtension) markup extension, which enables resources to be updated at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants