Skip to main content

ThemeVariant Class

Definition​

Assembly:Avalonia.Base
Package:Avalonia

Specifies a UI theme variant that should be used for the Control and Application types.

public class ThemeVariant

Inheritance: object -> ThemeVariant

Implements: IEquatable<ThemeVariant>

Constructors​

NameDescription
ThemeVariantCreates a new instance of the Avalonia.Styling.ThemeVariant

ThemeVariant Constructor​

Creates a new instance of the Avalonia.Styling.ThemeVariant

public ThemeVariant(object key, Avalonia.Styling.ThemeVariant inheritVariant)

Parameters​

key object

Key of the theme variant by which variants are compared.

inheritVariant Avalonia.Styling.ThemeVariant

Reference to a theme variant which should be used, if resource wasn't found for the requested variant.

Exceptions​

Methods​

NameDescription
<Clone>$No summary available.
Equals (2 overloads)No summary available.
GetHashCodeNo summary available.
ToStringNo summary available.

<Clone>$ Method​

public Avalonia.Styling.ThemeVariant <Clone>$()

Returns​

Avalonia.Styling.ThemeVariant

Equals overloads​

Equals Method​

public bool Equals(Avalonia.Styling.ThemeVariant other)
Parameters​

other Avalonia.Styling.ThemeVariant

Returns​

bool

Equals Method​

public bool Equals(object obj)
Parameters​

obj object

Returns​

bool

GetHashCode Method​

public int GetHashCode()

Returns​

int

ToString Method​

public string ToString()

Returns​

string

Properties​

NameDescription
DarkUse the Dark theme variant.
DefaultInherit 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.
InheritVariantReference to a theme variant which should be used, if resource wasn't found for the requested variant.
KeyKey of the theme variant by which variants are compared.
LightUse the Light theme variant.

Dark Property​

Use the Dark theme variant.

public Avalonia.Styling.ThemeVariant Dark { get; set; }

Default Property​

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 Avalonia.Styling.ThemeVariant Default { get; set; }

InheritVariant Property​

Reference to a theme variant which should be used, if resource wasn't found for the requested variant.

public Avalonia.Styling.ThemeVariant InheritVariant { get; set; }

Key Property​

Key of the theme variant by which variants are compared.

public object Key { get; set; }

Light Property​

Use the Light theme variant.

public Avalonia.Styling.ThemeVariant Light { get; set; }