Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 4
0
 private static void ReplaceBrush(ResourceDictionary dictionary, string name, string immersiveAccentName)
 {
     dictionary[name] = new SolidColorBrush(AccentColorService.GetColorByTypeName(immersiveAccentName));
 }