//public static void UpdateThemeResources(ResourceDictionary dictionary)
//{
// dictionary["WindowBackground"] = new SolidColorBrush(GetWindowBackgroundColor());
// SetBrush(dictionary, "WindowForeground", "ImmersiveApplicationTextDarkTheme");
// ReplaceBrush(dictionary, "CottonSwabSliderThumb", "ImmersiveSystemAccent");
// ReplaceBrush(dictionary, "CottonSwabSliderTrackBackground", SystemParameters.HighContrast ? "ImmersiveSystemAccentLight1" : "ImmersiveControlDarkSliderTrackBackgroundRest");
// SetBrushWithOpacity(dictionary, "CottonSwabSliderTrackBackgroundHover", SystemParameters.HighContrast ? "ImmersiveSystemAccentLight1" : "ImmersiveDarkBaseMediumHigh", SystemParameters.HighContrast ? 1.0 : 0.25);
// SetBrush(dictionary, "CottonSwabSliderTrackBackgroundPressed", "ImmersiveControlDarkSliderTrackBackgroundRest");
// ReplaceBrush(dictionary, "CottonSwabSliderTrackFill", "ImmersiveSystemAccentLight1");
// SetBrush(dictionary, "CottonSwabSliderThumbHover", "ImmersiveControlDarkSliderThumbHover");
// SetBrush(dictionary, "CottonSwabSliderThumbPressed", "ImmersiveControlDarkSliderThumbHover");
//}
/// <summary>
///
/// </summary>
/// <returns></returns>
public static Color GetWindowBackgroundColor()
{
string resource;
if (SystemInformation.HighContrast)
{
resource = "ImmersiveApplicationBackground";
}
else if (UserSystemPreferencesService.UseAccentColor)
{
resource = IsWindowTransparencyEnabled ? "ImmersiveSystemAccentDark2" : "ImmersiveSystemAccentDark1";
}
else
{
resource = "ImmersiveDarkChromeMedium";
}
Color color = AccentColorService.GetColorByTypeName(resource);
//return color;
//color.A = (byte)(IsWindowTransparencyEnabled ? 190 : 255);
return(Color.FromArgb(IsWindowTransparencyEnabled ? 190 : 255, color.R, color.G, color.B));
}