dotMorten/WinUIEx

Cant set Dark theme

Closed this issue · 3 comments

Hi @dotMorten I use WinUiE & its very usefull, many thanks for toolkit.

There is an issue with setting a WindowEx to the dark theme, it flashes/blinks Dark momentarily but remains Light. When i narrowed it down to WinUiEx I jumped here to see if WinUiEx supported theme changes in case there was a clash but this isnt the case.

Here is a basic project to demonstrate the problem.

Ok so now I see the WindowContent property. I have re-written the WindowEx ctor code

from this

var content = this.Content as FrameworkElement;
content.RequestedTheme = ElementTheme.Dark;

To this

var content = this.WindowContent as FrameworkElement;
content.RequestedTheme = ElementTheme.Dark;

Which works but there is a blink/flash from light to dark when the window opens, is there a way to avoid/fix this?

You can see the flash in your sample app if you set the theme to Dark and then switch between Mica & Acrylic.

The backdrop APIs has been removed in favor of the new Microsoft-provided APIs in v1.3 - let me know if you still see an issue, but in that case it's most likely a winappsdk issue.