Skip to main content

ThemeVariant Class

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

Definition

Namespace: Avalonia.Styling
Assembly: Avalonia.Base (in Avalonia.Base.dll)

[TypeConverterAttribute(typeof(ThemeVariantTypeConverter))]
public sealed class ThemeVariant : IEquatable<ThemeVariant>
View Source
InheritanceObject → ThemeVariant
ImplementsIEquatable(ThemeVariant)

Constructors

ThemeVariant(Object, ThemeVariant)Creates a new instance of the ThemeVariant

Properties

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.

Methods

Equals(ThemeVariant) 
GetHashCode()
(Overrides Object.GetHashCode())
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()
(Overrides Object.ToString())

Operators

Explicit(PlatformThemeVariant to ThemeVariant) 
Explicit(ThemeVariant to Nullable(PlatformThemeVariant)) 

See Also

Reference

Avalonia.Styling Namespace