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

Question: Application.RenderWithVisualStyles is always false - how can we set it to true? #2453

hughbe opened this issue Nov 30, 2019 · 0 comments


Copy link

@hughbe hughbe commented Nov 30, 2019

Basically I want to test some code that is conditional on Application.RenderWithVisualStyles

The issue is that Application.RenderWithVisualStyles is always false

The docs ( say

Doing research, I found that VisualStyleInformation.IsEnabledByUser is always false

VisualStyleInformation.IsEnabledByUser is implemented as

/// <summary>
///  Returns true if a visual style has currently been applied by the user, else false.
/// </summary>
public static bool IsEnabledByUser => UxTheme.IsAppThemed().IsTrue();

Is there a way to make UxTheme.IsAppThemed return true when running tests from dotnet test? When we call dotnet run, this works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.