Esempio 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;
        }
Esempio n. 2
0
                private void TimerEvent(ThreadPoolTimer timer)
                {
                    var temp = Edi.UWP.Helpers.UI.GetAccentColor();

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