Table of Contents

Class ResourceNodeExtensions

Namespace
CarinaStudio.Controls
Assembly
CarinaStudio.AppBase.Avalonia.dll

Extensions for Avalonia.Controls.IResourceNode.

public static class ResourceNodeExtensions
Inheritance
ResourceNodeExtensions
Inherited Members

Methods

TryGetResource<T>(IResourceNode, ThemeVariant?, object, out T?)

Try getting resource with given type.

public static bool TryGetResource<T>(this IResourceNode node, ThemeVariant? theme, object key, out T? res) where T : struct

Parameters

node IResourceNode

Avalonia.Controls.IResourceNode.

theme ThemeVariant

Theme.

key object

Resource key.

res T?

Found resource.

Returns

bool

True if resource got.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.

TryGetResource<T>(IResourceNode, ThemeVariant?, object, out T?)

Try getting resource with given type.

public static bool TryGetResource<T>(this IResourceNode node, ThemeVariant? theme, object key, out T? res) where T : class

Parameters

node IResourceNode

Avalonia.Controls.IResourceNode.

theme ThemeVariant

Theme.

key object

Resource key.

res T

Found resource.

Returns

bool

True if resource got.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.

TryGetResource<T>(IResourceNode, object, out T?)

Try getting resource with given type.

public static bool TryGetResource<T>(this IResourceNode node, object key, out T? res) where T : struct

Parameters

node IResourceNode

Avalonia.Controls.IResourceNode.

key object

Resource key.

res T?

Found resource.

Returns

bool

True if resource got.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.

TryGetResource<T>(IResourceNode, object, out T?)

Try getting resource with given type.

public static bool TryGetResource<T>(this IResourceNode node, object key, out T? res) where T : class

Parameters

node IResourceNode

Avalonia.Controls.IResourceNode.

key object

Resource key.

res T

Found resource.

Returns

bool

True if resource got.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.