Open Apskalle opened 1 month ago
Ah that's what I was noticing. I did notice a slight color change but wasn't really sure about it because I used TeamViewer and colors are strange there anyway.
Can confirm!
I facing same problem when using latest version 3.0.5
.
Update: Backdrop changing works fine if you instead of using ApplicationThemeManager.Apply() bind the windows WindowBackdropType property (change notification needed)
<ui:FluentWindow x:Class="Core.Login"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
...
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
WindowBackdropType="{Binding MyThemeManager.SelectedTheme.WindowBackdropType}"
ExtendsContentIntoTitleBar="True">
My MainWindow
must preserve transparency, and I use tray:NotifyIcon
without ui:FluentWindow
, thus I don't need backdrop functinonality. However, to facilitate tray menu reacting to theme changes, I've had to use the following code to workaround the issue with this code:
private void UpdateWPFUITheme(bool darkMode) {
ApplicationTheme theme = darkMode ? ApplicationTheme.Dark : ApplicationTheme.Light;
Window? mainWindow = UiApplication.Current.MainWindow;
UiApplication.Current.MainWindow = null;
ApplicationThemeManager.Apply(theme, Wpf.Ui.Controls.WindowBackdropType.None, false);
UiApplication.Current.MainWindow = mainWindow;
}
Describe the bug
When switching light to dark (or other way around) mica or acrylic transparency is lost.
To Reproduce
Can be tried on simple demo (https://github.com/lepoco/wpfui/tree/main/src/Wpf.Ui.Demo.Simple/)
Expected behavior
Theme should remain transparent
Screenshots
OS version
Windows 11 Pro Version 23H2 OS-version 22631.3880 Windows Feature Experience Pack 1000.22700.1020.0
.NET version
net 8.0, SDK 9 preview
WPF-UI NuGet version
3.0.4
Additional context
No response