5 instantiations of ThemeMode
PresentationFramework (5)
System\Windows\ThemeMode.cs (4)
29public static ThemeMode None => new ThemeMode(); 38public static ThemeMode Light => new ThemeMode("Light"); 47public static ThemeMode Dark => new ThemeMode("Dark"); 56public static ThemeMode System => new ThemeMode("System");
System\Windows\ThemeModeConverter.cs (1)
68return new ThemeMode(source.ToString());
77 references to ThemeMode
PresentationFramework (77)
System\Windows\Appearance\WindowBackdropManager.cs (1)
38if(!ThemeManager.IsFluentThemeEnabled && window.ThemeMode == ThemeMode.None)
System\Windows\Application.cs (10)
897if(value != null && ThemeMode != ThemeMode.None) 939/// <see cref="ThemeMode.None"/> - No Fluent theme is loaded. 940/// <see cref="ThemeMode.System"/> - Fluent theme is loaded based on the system theme. 941/// <see cref="ThemeMode.Light"/> - Fluent theme is loaded in Light mode. 942/// <see cref="ThemeMode.Dark"/> - Fluent theme is loaded in Dark mode. 946/// The default value is <see cref="ThemeMode.None"/>. 960public ThemeMode ThemeMode 974ThemeMode oldValue = _themeMode; 2435private ThemeMode _themeMode = ThemeMode.None;
System\Windows\ThemeManager.cs (35)
34if (window.ThemeMode == ThemeMode.None) 59if (window.ThemeMode == ThemeMode.None) 71internal static void OnApplicationThemeChanged(ThemeMode oldThemeMode, ThemeMode newThemeMode) 77if (newThemeMode == ThemeMode.None) 107internal static void OnWindowThemeChanged(Window window, ThemeMode oldThemeMode, ThemeMode newThemeMode) 109if (newThemeMode == ThemeMode.None) 123ThemeMode themeMode = GetThemeModeFromResourceDictionary(Application.Current.Resources); 128return themeMode == ThemeMode.None ? false : true; 136ThemeMode themeMode = GetThemeModeFromResourceDictionary(window.Resources); 146if (!IsFluentThemeEnabled && window.ThemeMode == ThemeMode.None) 151if (window.ThemeMode != ThemeMode.None) 163internal static bool IsValidThemeMode(ThemeMode themeMode) 165return themeMode == ThemeMode.None 166|| themeMode == ThemeMode.Light 167|| themeMode == ThemeMode.Dark 168|| themeMode == ThemeMode.System; 171internal static ResourceDictionary GetThemeDictionary(ThemeMode themeMode) 173if (themeMode == ThemeMode.None) 184if (themeMode == ThemeMode.System) 268if (IsFluentThemeEnabled || window.ThemeMode != ThemeMode.None) 324return Application.Current.ThemeMode != ThemeMode.None; 341private static bool GetUseLightColors(ThemeMode themeMode) 344if (themeMode == ThemeMode.None) 350return themeMode == ThemeMode.Light || (themeMode == ThemeMode.System && IsSystemThemeLight()); 353private static ThemeMode GetThemeModeFromResourceDictionary(ResourceDictionary rd) 355ThemeMode themeMode = ThemeMode.None; 370private static ThemeMode GetThemeModeFromSourceUri(Uri source) 373return ThemeMode.None; 378return ThemeMode.Light; 382return ThemeMode.Dark; 386return ThemeMode.System;
System\Windows\ThemeMode.cs (11)
17public readonly struct ThemeMode : IEquatable<ThemeMode> 29public static ThemeMode None => new ThemeMode(); 38public static ThemeMode Light => new ThemeMode("Light"); 47public static ThemeMode Dark => new ThemeMode("Dark"); 56public static ThemeMode System => new ThemeMode("System"); 76public bool Equals(ThemeMode other) => string.Equals(Value, other.Value, StringComparison.Ordinal); 85public override bool Equals(object obj) => obj is ThemeMode other && Equals(other); 101public static bool operator ==(ThemeMode left, ThemeMode right) => left.Equals(right); 111public static bool operator !=(ThemeMode left, ThemeMode right) => !left.Equals(right);
System\Windows\ThemeModeConverter.cs (8)
51/// Attempts to convert to a <see cref="ThemeMode"/> from the specified object 58/// <param name="source">The object to convert to a <see cref="ThemeMode"/>.</param> 60/// The new <see cref="ThemeMode"/> instance. 75/// Attempts to convert a <see cref="ThemeMode"/> object to the specified type. 81/// <paramref name="value" /> is <see langword="null" /> or not a <see cref="ThemeMode"/>, or <paramref name="destinationType" /> isn't a valid destination type. 85/// <param name="value">The <see cref="ThemeMode"/> to convert.</param> 97if (value is ThemeMode themeMode) 105ConstructorInfo ci = typeof(ThemeMode).GetConstructor(new Type[] { typeof(string) });
System\Windows\Window.cs (12)
550/// <see cref="ThemeMode.None"/> - No Fluent theme is loaded. However, if <see cref="Application.ThemeMode"/> is not None, 552/// <see cref="ThemeMode.System"/> - Fluent theme is loaded based on the system theme. 553/// <see cref="ThemeMode.Light"/> - Fluent theme is loaded in Light mode. 554/// <see cref="ThemeMode.Dark"/> - Fluent theme is loaded in Dark mode. 558/// The default value is <see cref="ThemeMode.None"/>. 573public ThemeMode ThemeMode 589ThemeMode oldTheme = _themeMode; 2138if(value != null && ThemeMode != ThemeMode.None) 2380if(ThemeMode != ThemeMode.None) 2591ThemeManager.OnWindowThemeChanged(this, ThemeMode.None, ThemeMode); 7275private ThemeMode _themeMode = ThemeMode.None;