5 instantiations of ThemeMode
PresentationFramework (5)
System\Windows\ThemeMode.cs (4)
29
public static ThemeMode None => new
ThemeMode
();
38
public static ThemeMode Light => new
ThemeMode
("Light");
47
public static ThemeMode Dark => new
ThemeMode
("Dark");
56
public static ThemeMode System => new
ThemeMode
("System");
System\Windows\ThemeModeConverter.cs (1)
68
return new
ThemeMode
(source.ToString());
77 references to ThemeMode
PresentationFramework (77)
System\Windows\Appearance\WindowBackdropManager.cs (1)
38
if(!ThemeManager.IsFluentThemeEnabled && window.ThemeMode ==
ThemeMode
.None)
System\Windows\Application.cs (10)
897
if(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"/>.
960
public
ThemeMode
ThemeMode
974
ThemeMode
oldValue = _themeMode;
2435
private
ThemeMode
_themeMode =
ThemeMode
.None;
System\Windows\ThemeManager.cs (35)
34
if (window.ThemeMode ==
ThemeMode
.None)
59
if (window.ThemeMode ==
ThemeMode
.None)
71
internal static void OnApplicationThemeChanged(
ThemeMode
oldThemeMode,
ThemeMode
newThemeMode)
77
if (newThemeMode ==
ThemeMode
.None)
107
internal static void OnWindowThemeChanged(Window window,
ThemeMode
oldThemeMode,
ThemeMode
newThemeMode)
109
if (newThemeMode ==
ThemeMode
.None)
123
ThemeMode
themeMode = GetThemeModeFromResourceDictionary(Application.Current.Resources);
128
return themeMode ==
ThemeMode
.None ? false : true;
136
ThemeMode
themeMode = GetThemeModeFromResourceDictionary(window.Resources);
146
if (!IsFluentThemeEnabled && window.ThemeMode ==
ThemeMode
.None)
151
if (window.ThemeMode !=
ThemeMode
.None)
163
internal static bool IsValidThemeMode(
ThemeMode
themeMode)
165
return themeMode ==
ThemeMode
.None
166
|| themeMode ==
ThemeMode
.Light
167
|| themeMode ==
ThemeMode
.Dark
168
|| themeMode ==
ThemeMode
.System;
171
internal static ResourceDictionary GetThemeDictionary(
ThemeMode
themeMode)
173
if (themeMode ==
ThemeMode
.None)
184
if (themeMode ==
ThemeMode
.System)
268
if (IsFluentThemeEnabled || window.ThemeMode !=
ThemeMode
.None)
324
return Application.Current.ThemeMode !=
ThemeMode
.None;
341
private static bool GetUseLightColors(
ThemeMode
themeMode)
344
if (themeMode ==
ThemeMode
.None)
350
return themeMode ==
ThemeMode
.Light || (themeMode ==
ThemeMode
.System && IsSystemThemeLight());
353
private static
ThemeMode
GetThemeModeFromResourceDictionary(ResourceDictionary rd)
355
ThemeMode
themeMode =
ThemeMode
.None;
370
private static
ThemeMode
GetThemeModeFromSourceUri(Uri source)
373
return
ThemeMode
.None;
378
return
ThemeMode
.Light;
382
return
ThemeMode
.Dark;
386
return
ThemeMode
.System;
System\Windows\ThemeMode.cs (11)
17
public readonly struct ThemeMode : IEquatable<
ThemeMode
>
29
public static
ThemeMode
None => new ThemeMode();
38
public static
ThemeMode
Light => new ThemeMode("Light");
47
public static
ThemeMode
Dark => new ThemeMode("Dark");
56
public static
ThemeMode
System => new ThemeMode("System");
76
public bool Equals(
ThemeMode
other) => string.Equals(Value, other.Value, StringComparison.Ordinal);
85
public override bool Equals(object obj) => obj is
ThemeMode
other && Equals(other);
101
public static bool operator ==(
ThemeMode
left,
ThemeMode
right) => left.Equals(right);
111
public 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>
97
if (value is
ThemeMode
themeMode)
105
ConstructorInfo 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"/>.
573
public
ThemeMode
ThemeMode
589
ThemeMode
oldTheme = _themeMode;
2138
if(value != null && ThemeMode !=
ThemeMode
.None)
2380
if(ThemeMode !=
ThemeMode
.None)
2591
ThemeManager.OnWindowThemeChanged(this,
ThemeMode
.None, ThemeMode);
7275
private
ThemeMode
_themeMode =
ThemeMode
.None;