You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You'll probably need to ask Windows what the system theme is. This StackOverflow question has some suitable solutions.
This one checks the value of the registry key (0 = dark; 1 = light).
This one is a bit of a hack, but I've confirmed that it works. It uses the Microsoft.Windows.SDK.Contracts package to get the color values for the foreground and background and uses them to determine whether the theme is dark or light.
In visual studio there is the option for the theme to track the system default theme which returns a guid of
{619dac1e-8220-4bd9-96fb-75ceb61a6107}
This is not accounted for here: https://github.com/VsixCommunity/Community.VisualStudio.Toolkit/blob/master/demo/VSSDK.TestExtension/ToolWindows/ThemeWindow/ThemeWindowControlViewModel.cs#L21-L44 What's the best solution to resolve light or dark theme based on this?The text was updated successfully, but these errors were encountered: