Ejemplo n.º 1
0
        private void ListenToSystemColorChanges()
        {
            var uiSettings = new UISettings();

            _systemBackground = uiSettings.GetColorValue(UIColorType.Background).ToColor();
            _systemAccent     = uiSettings.GetColorValue(UIColorType.Accent).ToColor();

            uiSettings.ColorValuesChanged += (sender, args) =>
            {
#if DEBUG
                //for (int i = 0; i <= 8; i++)
                //{
                //    var colorType = (UIColorType)i;
                //    Debug.WriteLine(colorType + " = " + sender.GetColorValue(colorType));
                //}
#endif
                var background = sender.GetColorValue(UIColorType.Background).ToColor();
                if (_systemBackground != background)
                {
                    _systemBackground = background;
                    BackgroundColorChanged?.Invoke(null, EventArgs.Empty);
                }

                var accent = sender.GetColorValue(UIColorType.Accent).ToColor();
                if (_systemAccent != accent)
                {
                    _systemAccent = accent;
                    AccentColorChanged?.Invoke(null, EventArgs.Empty);
                }
            };

            _uiSettings = uiSettings;
        }
Ejemplo n.º 2
0
                private void TimerEvent(ThreadPoolTimer timer)
                {
                    var temp = Edi.UWP.Helpers.UI.GetAccentColor();

                    if (temp != accentColor)
                    {
                        accentColor = temp;
                        AccentColorChanged?.Invoke(accentColor);
                    }
                }
Ejemplo n.º 3
0
 private static void OnAccentColorChanged()
 {
     if (AccentColorInfo.Name == "Default")
     {
         ThemeManager.ClearOverloads();
     }
     else
     {
         AccentColorizer.Apply(AccentColorInfo.AccentColor);
     }
     AccentColorChanged?.Invoke(null, null);
 }
Ejemplo n.º 4
0
 protected void RaiseAccentColorChanged()
 {
     AccentColorChanged?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 5
0
 private static void OnAccentColorChanged()
 {
     AccentColorChanged?.Invoke(null, EventArgs.Empty);
 }