Table of Contents

Interface IResourceNode

Namespace
Avalonia.Controls
Assembly
Avalonia.Base.dll

Represents an object that can be queried for resources.

[NotClientImplementable]
public interface IResourceNode

Remarks

The interface represents a common interface for both controls that host resources (IResourceHost) and resource providers such as ResourceDictionary (see IResourceProvider).

Properties

HasResources

Gets a value indicating whether the object has resources.

bool HasResources { get; }

Property Value

bool

Methods

TryGetResource(object, ThemeVariant?, out object?)

Tries to find a resource within the object.

bool TryGetResource(object key, ThemeVariant? theme, out object? value)

Parameters

key object

The resource key.

theme ThemeVariant

Theme used to select theme dictionary.

value object

When this method returns, contains the value associated with the specified key, if the key is found; otherwise, null.

Returns

bool

True if the resource if found, otherwise false.