From ed703a1a3230425deaa45dd337ad16053d110c9b Mon Sep 17 00:00:00 2001 From: Julien Lebosquain Date: Mon, 22 Jun 2026 11:59:17 +0200 Subject: [PATCH] Fix RequestedThemeVariant default value (#21624) --- src/Avalonia.Base/Styling/ThemeVariant.cs | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Avalonia.Base/Styling/ThemeVariant.cs b/src/Avalonia.Base/Styling/ThemeVariant.cs index ac44fddb99..5414d340bf 100644 --- a/src/Avalonia.Base/Styling/ThemeVariant.cs +++ b/src/Avalonia.Base/Styling/ThemeVariant.cs @@ -15,6 +15,22 @@ namespace Avalonia.Styling; "Ideally we woould introduce readonly styled properties.")] public sealed record ThemeVariant { + /// + /// Inherit theme variant from the parent. If set on Application, system theme is inherited. + /// Using Default as the ResourceDictionary.Key marks this dictionary as a fallback in case the theme variant or resource key is not found in other theme dictionaries. + /// + public static ThemeVariant Default { get; } = new(nameof(Default)); + + /// + /// Use the Light theme variant. + /// + public static ThemeVariant Light { get; } = new(nameof(Light)); + + /// + /// Use the Dark theme variant. + /// + public static ThemeVariant Dark { get; } = new(nameof(Dark)); + /// /// Defines the ActualThemeVariant property. /// @@ -63,22 +79,6 @@ public sealed record ThemeVariant /// public ThemeVariant? InheritVariant { get; } - /// - /// Inherit theme variant from the parent. If set on Application, system theme is inherited. - /// Using Default as the ResourceDictionary.Key marks this dictionary as a fallback in case the theme variant or resource key is not found in other theme dictionaries. - /// - public static ThemeVariant Default { get; } = new(nameof(Default)); - - /// - /// Use the Light theme variant. - /// - public static ThemeVariant Light { get; } = new(nameof(Light)); - - /// - /// Use the Dark theme variant. - /// - public static ThemeVariant Dark { get; } = new(nameof(Dark)); - public override string ToString() { return Key.ToString() ?? $"ThemeVariant {{ Key = {Key} }}";