5 instantiations of ThemeMode
PresentationFramework (5)
System\Windows\ThemeMode.cs (4)
42public static ThemeMode None => new ThemeMode(); 51public static ThemeMode Light => new ThemeMode("Light"); 60public static ThemeMode Dark => new ThemeMode("Dark"); 69public static ThemeMode System => new ThemeMode("System");
System\Windows\ThemeModeConverter.cs (1)
76return new ThemeMode(source.ToString());
77 references to ThemeMode
PresentationFramework (77)
System\Windows\Appearance\WindowBackdropManager.cs (1)
36if(!ThemeManager.IsFluentThemeEnabled && window.ThemeMode == ThemeMode.None)
System\Windows\Application.cs (10)
937if(value != null && ThemeMode != ThemeMode.None) 979/// <see cref="ThemeMode.None"/> - No Fluent theme is loaded. 980/// <see cref="ThemeMode.System"/> - Fluent theme is loaded based on the system theme. 981/// <see cref="ThemeMode.Light"/> - Fluent theme is loaded in Light mode. 982/// <see cref="ThemeMode.Dark"/> - Fluent theme is loaded in Dark mode. 986/// The default value is <see cref="ThemeMode.None"/>. 1000public ThemeMode ThemeMode 1014ThemeMode oldValue = _themeMode; 2525private ThemeMode _themeMode = ThemeMode.None;
System\Windows\ThemeManager.cs (35)
40if (window.ThemeMode == ThemeMode.None) 65if (window.ThemeMode == ThemeMode.None) 77internal static void OnApplicationThemeChanged(ThemeMode oldThemeMode, ThemeMode newThemeMode) 83if (newThemeMode == ThemeMode.None) 113internal static void OnWindowThemeChanged(Window window, ThemeMode oldThemeMode, ThemeMode newThemeMode) 115if (newThemeMode == ThemeMode.None) 129ThemeMode themeMode = GetThemeModeFromResourceDictionary(Application.Current.Resources); 134return themeMode == ThemeMode.None ? false : true; 142ThemeMode themeMode = GetThemeModeFromResourceDictionary(window.Resources); 152if (!IsFluentThemeEnabled && window.ThemeMode == ThemeMode.None) 157if (window.ThemeMode != ThemeMode.None) 169internal static bool IsValidThemeMode(ThemeMode themeMode) 171return themeMode == ThemeMode.None 172|| themeMode == ThemeMode.Light 173|| themeMode == ThemeMode.Dark 174|| themeMode == ThemeMode.System; 177internal static ResourceDictionary GetThemeDictionary(ThemeMode themeMode) 179if (themeMode == ThemeMode.None) 190if (themeMode == ThemeMode.System) 274if (IsFluentThemeEnabled || window.ThemeMode != ThemeMode.None) 323return Application.Current.ThemeMode != ThemeMode.None; 340private static bool GetUseLightColors(ThemeMode themeMode) 343if (themeMode == ThemeMode.None) 349return themeMode == ThemeMode.Light || (themeMode == ThemeMode.System && IsSystemThemeLight()); 352private static ThemeMode GetThemeModeFromResourceDictionary(ResourceDictionary rd) 354ThemeMode themeMode = ThemeMode.None; 369private static ThemeMode GetThemeModeFromSourceUri(Uri source) 372return ThemeMode.None; 377return ThemeMode.Light; 381return ThemeMode.Dark; 385return ThemeMode.System;
System\Windows\ThemeMode.cs (11)
30public readonly struct ThemeMode : IEquatable<ThemeMode> 42public static ThemeMode None => new ThemeMode(); 51public static ThemeMode Light => new ThemeMode("Light"); 60public static ThemeMode Dark => new ThemeMode("Dark"); 69public static ThemeMode System => new ThemeMode("System"); 89public bool Equals(ThemeMode other) => string.Equals(Value, other.Value, StringComparison.Ordinal); 98public override bool Equals(object obj) => obj is ThemeMode other && Equals(other); 114public static bool operator ==(ThemeMode left, ThemeMode right) => left.Equals(right); 124public static bool operator !=(ThemeMode left, ThemeMode right) => !left.Equals(right);
System\Windows\ThemeModeConverter.cs (8)
59/// Attempts to convert to a <see cref="ThemeMode"/> from the specified object 66/// <param name="source">The object to convert to a <see cref="ThemeMode"/>.</param> 68/// The new <see cref="ThemeMode"/> instance. 83/// Attempts to convert a <see cref="ThemeMode"/> object to the specified type. 89/// <paramref name="value" /> is <see langword="null" /> or not a <see cref="ThemeMode"/>, or <paramref name="destinationType" /> isn't a valid destination type. 93/// <param name="value">The <see cref="ThemeMode"/> to convert.</param> 105if (value is ThemeMode themeMode) 113ConstructorInfo ci = typeof(ThemeMode).GetConstructor(new Type[] { typeof(string) });
System\Windows\Window.cs (12)
572/// <see cref="ThemeMode.None"/> - No Fluent theme is loaded. However, if <see cref="Application.ThemeMode"/> is not None, 574/// <see cref="ThemeMode.System"/> - Fluent theme is loaded based on the system theme. 575/// <see cref="ThemeMode.Light"/> - Fluent theme is loaded in Light mode. 576/// <see cref="ThemeMode.Dark"/> - Fluent theme is loaded in Dark mode. 580/// The default value is <see cref="ThemeMode.None"/>. 595public ThemeMode ThemeMode 611ThemeMode oldTheme = _themeMode; 2165if(value != null && ThemeMode != ThemeMode.None) 2409if(ThemeMode != ThemeMode.None) 2621ThemeManager.OnWindowThemeChanged(this, ThemeMode.None, ThemeMode); 7319private ThemeMode _themeMode = ThemeMode.None;