5 instantiations of ThemeMode
PresentationFramework (5)
System\Windows\ThemeMode.cs (4)
30
public static ThemeMode None => new
ThemeMode
();
39
public static ThemeMode Light => new
ThemeMode
("Light");
48
public static ThemeMode Dark => new
ThemeMode
("Dark");
57
public static ThemeMode System => new
ThemeMode
("System");
System\Windows\ThemeModeConverter.cs (1)
69
return new
ThemeMode
(source.ToString());
77 references to ThemeMode
PresentationFramework (77)
System\Windows\Appearance\WindowBackdropManager.cs (1)
35
if(!ThemeManager.IsFluentThemeEnabled && window.ThemeMode ==
ThemeMode
.None)
System\Windows\Application.cs (10)
924
if(value != null && ThemeMode !=
ThemeMode
.None)
966
/// <see cref="
ThemeMode
.None"/> - No Fluent theme is loaded.
967
/// <see cref="
ThemeMode
.System"/> - Fluent theme is loaded based on the system theme.
968
/// <see cref="
ThemeMode
.Light"/> - Fluent theme is loaded in Light mode.
969
/// <see cref="
ThemeMode
.Dark"/> - Fluent theme is loaded in Dark mode.
973
/// The default value is <see cref="
ThemeMode
.None"/>.
987
public
ThemeMode
ThemeMode
1001
ThemeMode
oldValue = _themeMode;
2512
private
ThemeMode
_themeMode =
ThemeMode
.None;
System\Windows\ThemeManager.cs (35)
31
if (window.ThemeMode ==
ThemeMode
.None)
56
if (window.ThemeMode ==
ThemeMode
.None)
68
internal static void OnApplicationThemeChanged(
ThemeMode
oldThemeMode,
ThemeMode
newThemeMode)
74
if (newThemeMode ==
ThemeMode
.None)
104
internal static void OnWindowThemeChanged(Window window,
ThemeMode
oldThemeMode,
ThemeMode
newThemeMode)
106
if (newThemeMode ==
ThemeMode
.None)
120
ThemeMode
themeMode = GetThemeModeFromResourceDictionary(Application.Current.Resources);
125
return themeMode ==
ThemeMode
.None ? false : true;
133
ThemeMode
themeMode = GetThemeModeFromResourceDictionary(window.Resources);
143
if (!IsFluentThemeEnabled && window.ThemeMode ==
ThemeMode
.None)
148
if (window.ThemeMode !=
ThemeMode
.None)
160
internal static bool IsValidThemeMode(
ThemeMode
themeMode)
162
return themeMode ==
ThemeMode
.None
163
|| themeMode ==
ThemeMode
.Light
164
|| themeMode ==
ThemeMode
.Dark
165
|| themeMode ==
ThemeMode
.System;
168
internal static ResourceDictionary GetThemeDictionary(
ThemeMode
themeMode)
170
if (themeMode ==
ThemeMode
.None)
181
if (themeMode ==
ThemeMode
.System)
265
if (IsFluentThemeEnabled || window.ThemeMode !=
ThemeMode
.None)
314
return Application.Current.ThemeMode !=
ThemeMode
.None;
331
private static bool GetUseLightColors(
ThemeMode
themeMode)
334
if (themeMode ==
ThemeMode
.None)
340
return themeMode ==
ThemeMode
.Light || (themeMode ==
ThemeMode
.System && IsSystemThemeLight());
343
private static
ThemeMode
GetThemeModeFromResourceDictionary(ResourceDictionary rd)
345
ThemeMode
themeMode =
ThemeMode
.None;
360
private static
ThemeMode
GetThemeModeFromSourceUri(Uri source)
363
return
ThemeMode
.None;
368
return
ThemeMode
.Light;
372
return
ThemeMode
.Dark;
376
return
ThemeMode
.System;
System\Windows\ThemeMode.cs (11)
18
public readonly struct ThemeMode : IEquatable<
ThemeMode
>
30
public static
ThemeMode
None => new ThemeMode();
39
public static
ThemeMode
Light => new ThemeMode("Light");
48
public static
ThemeMode
Dark => new ThemeMode("Dark");
57
public static
ThemeMode
System => new ThemeMode("System");
77
public bool Equals(
ThemeMode
other) => string.Equals(Value, other.Value, StringComparison.Ordinal);
86
public override bool Equals(object obj) => obj is
ThemeMode
other && Equals(other);
102
public static bool operator ==(
ThemeMode
left,
ThemeMode
right) => left.Equals(right);
112
public static bool operator !=(
ThemeMode
left,
ThemeMode
right) => !left.Equals(right);
System\Windows\ThemeModeConverter.cs (8)
52
/// Attempts to convert to a <see cref="
ThemeMode
"/> from the specified object
59
/// <param name="source">The object to convert to a <see cref="
ThemeMode
"/>.</param>
61
/// The new <see cref="
ThemeMode
"/> instance.
76
/// Attempts to convert a <see cref="
ThemeMode
"/> object to the specified type.
82
/// <paramref name="value" /> is <see langword="null" /> or not a <see cref="
ThemeMode
"/>, or <paramref name="destinationType" /> isn't a valid destination type.
86
/// <param name="value">The <see cref="
ThemeMode
"/> to convert.</param>
98
if (value is
ThemeMode
themeMode)
106
ConstructorInfo ci = typeof(
ThemeMode
).GetConstructor(new Type[] { typeof(string) });
System\Windows\Window.cs (12)
559
/// <see cref="
ThemeMode
.None"/> - No Fluent theme is loaded. However, if <see cref="Application.ThemeMode"/> is not None,
561
/// <see cref="
ThemeMode
.System"/> - Fluent theme is loaded based on the system theme.
562
/// <see cref="
ThemeMode
.Light"/> - Fluent theme is loaded in Light mode.
563
/// <see cref="
ThemeMode
.Dark"/> - Fluent theme is loaded in Dark mode.
567
/// The default value is <see cref="
ThemeMode
.None"/>.
582
public
ThemeMode
ThemeMode
598
ThemeMode
oldTheme = _themeMode;
2152
if(value != null && ThemeMode !=
ThemeMode
.None)
2396
if(ThemeMode !=
ThemeMode
.None)
2608
ThemeManager.OnWindowThemeChanged(this,
ThemeMode
.None, ThemeMode);
7306
private
ThemeMode
_themeMode =
ThemeMode
.None;