How to set preferredcolorscheme #4115
Unanswered
Daniellled
asked this question in
Q&A
Replies: 2 comments 1 reply
-
@peiche-jessica would you be able to help this user out? |
Beta Was this translation helpful? Give feedback.
1 reply
-
@Daniellled you can use the PreferredColorScheme property to set this value. It is on the CoreWebView2.CoreWebView2Profile object Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using the WebView2 control for WPF. I see API's related to setting the browser theme, dark, light, OS default. - https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2profile?view=webview2-1.0.1587.40 and https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2profile.preferredcolorscheme?view=webview2-dotnet-1.0.1189-prerelease#microsoft-web-webview2-core-corewebview2profile-preferredcolorscheme
Where do I set that profile? I am simply using the WebView2 control in my xaml and invoking MyWebView2.EnsureCoreWebView2Async(); in the code behind.
Is it possible to set this property via dependency property. Similar to how you can set the DefaultBackgroundColor?
Beta Was this translation helpful? Give feedback.
All reactions