Skip to main content

IThemeVariantProvider Interface

Resource provider with theme variant awareness. Can be used with ThemeDictionaries.

Definition​

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

public interface IThemeVariantProvider : IResourceProvider, 
IResourceNode
View Source
ImplementsIResourceNode, IResourceProvider

Remarks​

This is a helper interface for the XAML compiler to make Key property accessibly by the markup extensions. Which means, it can only be used with ResourceDictionaries and markup extensions in the XAML code.

Properties​

HasResourcesGets a value indicating whether the object has resources.
(Inherited from IResourceNode)
KeyKey property set by the compiler.
OwnerGets the owner of the resource provider.
(Inherited from IResourceProvider)

Methods​

AddOwner(IResourceHost)Adds an owner to the resource provider.
(Inherited from IResourceProvider)
RemoveOwner(IResourceHost)Removes a resource provider owner.
(Inherited from IResourceProvider)
TryGetResource(Object, ThemeVariant, Object)Tries to find a resource within the object.
(Inherited from IResourceNode)

Events​

OwnerChangedRaised when the Owner of the resource provider changes.
(Inherited from IResourceProvider)

Extension Methods​

GetResourceObservable(Object, Func(Object, Object))
(Defined by ResourceNodeExtensions)
GetResourceObservable(Object, ThemeVariant, Func(Object, Object))
(Defined by ResourceNodeExtensions)

See Also​

Reference​

Avalonia.Controls Namespace