/// <summary> /// Sets the system accent colors from the users settings /// </summary> private void SetSystemAccentColorsFromSystem(IResourceDictionary resources) { var themeAccent = Win32Interop.GetThemeColorRef("ImmersiveSystemAccent"); var themeAccentLight1 = Win32Interop.GetThemeColorRef("ImmersiveSystemAccentLight1"); var themeAccentLight2 = Win32Interop.GetThemeColorRef("ImmersiveSystemAccentLight2"); var themeAccentLight3 = Win32Interop.GetThemeColorRef("ImmersiveSystemAccentLight3"); var themeAccentDark1 = Win32Interop.GetThemeColorRef("ImmersiveSystemAccentDark1"); var themeAccentDark2 = Win32Interop.GetThemeColorRef("ImmersiveSystemAccentDark2"); var themeAccentDark3 = Win32Interop.GetThemeColorRef("ImmersiveSystemAccentDark3"); resources["SystemAccentColor"] = themeAccent; resources["SystemAccentColorLight1"] = themeAccentLight1; resources["SystemAccentColorLight2"] = themeAccentLight2; resources["SystemAccentColorLight3"] = themeAccentLight3; resources["SystemAccentColorDark1"] = themeAccentDark1; resources["SystemAccentColorDark2"] = themeAccentDark2; resources["SystemAccentColorDark3"] = themeAccentDark3; }