示例#1
0
        private static void ReplaceBrushWithOpacity(ResourceDictionary dictionary, string name, string immersiveAccentName, double opacity)
        {
            var color = AccentColorService.GetColorByTypeName(immersiveAccentName);

            color.A          = (byte)(opacity * 255);
            dictionary[name] = new SolidColorBrush(color);
        }
示例#2
0
        private static void SetBrushWithOpacity(ResourceDictionary dictionary, string name, string immersiveAccentName, double opacity)
        {
            var color = AccentColorService.GetColorByTypeName(immersiveAccentName);

            color.A = (byte)(opacity * 255);
            ((SolidColorBrush)dictionary[name]).Color = color;
        }
示例#3
0
        private static Color GetWindowBackgroundColor()
        {
            string resource;

            if (SystemParameters.HighContrast)
            {
                resource = "ImmersiveApplicationBackground";
            }
            else if (UserSystemPreferencesService.UseAccentColor)
            {
                resource = IsWindowTransparencyEnabled ? "ImmersiveSystemAccentDark2" : "ImmersiveSystemAccentDark1";
            }
            else
            {
                resource = "ImmersiveDarkChromeMedium";
            }

            var color = AccentColorService.GetColorByTypeName(resource);

            color.A = (byte)(IsWindowTransparencyEnabled ? 190 : 255);
            return(color);
        }
示例#4
0
 private static void ReplaceBrush(ResourceDictionary dictionary, string name, string immersiveAccentName)
 {
     dictionary[name] = new SolidColorBrush(AccentColorService.GetColorByTypeName(immersiveAccentName));
 }