Ensure the flyout respects the given RequestedTheme... although it doesn't seem to be picking up the theme changes from Windows user settings just yet...
This commit is contained in:
@@ -81,6 +81,11 @@ namespace NotificationFlyout.Wpf.UI.Controls
|
||||
}
|
||||
|
||||
private void OnIconPropertyChanged()
|
||||
{
|
||||
SetIcon();
|
||||
}
|
||||
|
||||
private void SetIcon()
|
||||
{
|
||||
var shellTrayHandle = WindowHelper.GetHandle(ShellTrayHandleName);
|
||||
if (shellTrayHandle == null) return;
|
||||
@@ -88,8 +93,9 @@ namespace NotificationFlyout.Wpf.UI.Controls
|
||||
var dpi = WindowHelper.GetDpi(shellTrayHandle);
|
||||
|
||||
var iconSource = SystemSettingsHelper.DefaultSystemTheme == SystemTheme.Dark ? IconSource : LightIconSource;
|
||||
using var icon = iconSource.ConvertToIcon(dpi);
|
||||
if (iconSource == null) return;
|
||||
|
||||
using var icon = iconSource.ConvertToIcon(dpi);
|
||||
_xamlHost.SetNotificationIcon(icon.Handle);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user