Browse Source

Fix RequestedThemeVariant default value (#21624)

pull/21626/head
Julien Lebosquain 3 months ago
committed by GitHub
parent
commit
ed703a1a32
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 32
      src/Avalonia.Base/Styling/ThemeVariant.cs

32
src/Avalonia.Base/Styling/ThemeVariant.cs

@ -15,6 +15,22 @@ namespace Avalonia.Styling;
"Ideally we woould introduce readonly styled properties.")]
public sealed record ThemeVariant
{
/// <summary>
/// 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.
/// </summary>
public static ThemeVariant Default { get; } = new(nameof(Default));
/// <summary>
/// Use the Light theme variant.
/// </summary>
public static ThemeVariant Light { get; } = new(nameof(Light));
/// <summary>
/// Use the Dark theme variant.
/// </summary>
public static ThemeVariant Dark { get; } = new(nameof(Dark));
/// <summary>
/// Defines the ActualThemeVariant property.
/// </summary>
@ -63,22 +79,6 @@ public sealed record ThemeVariant
/// </summary>
public ThemeVariant? InheritVariant { get; }
/// <summary>
/// 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.
/// </summary>
public static ThemeVariant Default { get; } = new(nameof(Default));
/// <summary>
/// Use the Light theme variant.
/// </summary>
public static ThemeVariant Light { get; } = new(nameof(Light));
/// <summary>
/// Use the Dark theme variant.
/// </summary>
public static ThemeVariant Dark { get; } = new(nameof(Dark));
public override string ToString()
{
return Key.ToString() ?? $"ThemeVariant {{ Key = {Key} }}";

Loading…
Cancel
Save