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; }
private void TimerEvent(ThreadPoolTimer timer) { var temp = Edi.UWP.Helpers.UI.GetAccentColor(); if (temp != accentColor) { accentColor = temp; AccentColorChanged?.Invoke(accentColor); } }
private static void OnAccentColorChanged() { if (AccentColorInfo.Name == "Default") { ThemeManager.ClearOverloads(); } else { AccentColorizer.Apply(AccentColorInfo.AccentColor); } AccentColorChanged?.Invoke(null, null); }
protected void RaiseAccentColorChanged() { AccentColorChanged?.Invoke(this, EventArgs.Empty); }
private static void OnAccentColorChanged() { AccentColorChanged?.Invoke(null, EventArgs.Empty); }