5 instantiations of ThemeMode
PresentationFramework (5)
System\Windows\ThemeMode.cs (4)
42
public static ThemeMode None => new
ThemeMode
();
51
public static ThemeMode Light => new
ThemeMode
("Light");
60
public static ThemeMode Dark => new
ThemeMode
("Dark");
69
public static ThemeMode System => new
ThemeMode
("System");
System\Windows\ThemeModeConverter.cs (1)
76
return new
ThemeMode
(source.ToString());
77 references to ThemeMode
PresentationFramework (77)
System\Windows\Appearance\WindowBackdropManager.cs (1)
36
if(!ThemeManager.IsFluentThemeEnabled && window.ThemeMode ==
ThemeMode
.None)
System\Windows\Application.cs (10)
937
if(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"/>.
1000
public
ThemeMode
ThemeMode
1014
ThemeMode
oldValue = _themeMode;
2525
private
ThemeMode
_themeMode =
ThemeMode
.None;
System\Windows\ThemeManager.cs (35)
40
if (window.ThemeMode ==
ThemeMode
.None)
65
if (window.ThemeMode ==
ThemeMode
.None)
77
internal static void OnApplicationThemeChanged(
ThemeMode
oldThemeMode,
ThemeMode
newThemeMode)
83
if (newThemeMode ==
ThemeMode
.None)
113
internal static void OnWindowThemeChanged(Window window,
ThemeMode
oldThemeMode,
ThemeMode
newThemeMode)
115
if (newThemeMode ==
ThemeMode
.None)
129
ThemeMode
themeMode = GetThemeModeFromResourceDictionary(Application.Current.Resources);
134
return themeMode ==
ThemeMode
.None ? false : true;
142
ThemeMode
themeMode = GetThemeModeFromResourceDictionary(window.Resources);
152
if (!IsFluentThemeEnabled && window.ThemeMode ==
ThemeMode
.None)
157
if (window.ThemeMode !=
ThemeMode
.None)
169
internal static bool IsValidThemeMode(
ThemeMode
themeMode)
171
return themeMode ==
ThemeMode
.None
172
|| themeMode ==
ThemeMode
.Light
173
|| themeMode ==
ThemeMode
.Dark
174
|| themeMode ==
ThemeMode
.System;
177
internal static ResourceDictionary GetThemeDictionary(
ThemeMode
themeMode)
179
if (themeMode ==
ThemeMode
.None)
190
if (themeMode ==
ThemeMode
.System)
274
if (IsFluentThemeEnabled || window.ThemeMode !=
ThemeMode
.None)
323
return Application.Current.ThemeMode !=
ThemeMode
.None;
340
private static bool GetUseLightColors(
ThemeMode
themeMode)
343
if (themeMode ==
ThemeMode
.None)
349
return themeMode ==
ThemeMode
.Light || (themeMode ==
ThemeMode
.System && IsSystemThemeLight());
352
private static
ThemeMode
GetThemeModeFromResourceDictionary(ResourceDictionary rd)
354
ThemeMode
themeMode =
ThemeMode
.None;
369
private static
ThemeMode
GetThemeModeFromSourceUri(Uri source)
372
return
ThemeMode
.None;
377
return
ThemeMode
.Light;
381
return
ThemeMode
.Dark;
385
return
ThemeMode
.System;
System\Windows\ThemeMode.cs (11)
30
public readonly struct ThemeMode : IEquatable<
ThemeMode
>
42
public static
ThemeMode
None => new ThemeMode();
51
public static
ThemeMode
Light => new ThemeMode("Light");
60
public static
ThemeMode
Dark => new ThemeMode("Dark");
69
public static
ThemeMode
System => new ThemeMode("System");
89
public bool Equals(
ThemeMode
other) => string.Equals(Value, other.Value, StringComparison.Ordinal);
98
public override bool Equals(object obj) => obj is
ThemeMode
other && Equals(other);
114
public static bool operator ==(
ThemeMode
left,
ThemeMode
right) => left.Equals(right);
124
public 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>
105
if (value is
ThemeMode
themeMode)
113
ConstructorInfo 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"/>.
595
public
ThemeMode
ThemeMode
611
ThemeMode
oldTheme = _themeMode;
2165
if(value != null && ThemeMode !=
ThemeMode
.None)
2409
if(ThemeMode !=
ThemeMode
.None)
2621
ThemeManager.OnWindowThemeChanged(this,
ThemeMode
.None, ThemeMode);
7319
private
ThemeMode
_themeMode =
ThemeMode
.None;