Table of Contents

Class AvaloniaApplicationExtensions

Namespace
CarinaStudio
Assembly
CarinaStudio.AppBase.Application.Avalonia.dll

Extensions for IAvaloniaApplication.

public static class AvaloniaApplicationExtensions
Inheritance
AvaloniaApplicationExtensions
Inherited Members

Methods

FindResourceOrDefault<T>(IAvaloniaApplication, object, ThemeVariant?, T)

Find resource with given type or use default value.

public static T FindResourceOrDefault<T>(this IAvaloniaApplication app, object key, ThemeVariant? theme, T defaultValue = default)

Parameters

app IAvaloniaApplication

IAvaloniaApplication.

key object

Resource key.

theme ThemeVariant

Theme.

defaultValue T

Default value.

Returns

T

Resource with given key and type, or default value.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.

FindResourceOrDefault<T>(IAvaloniaApplication, object, T)

Find resource with given type or use default value.

public static T FindResourceOrDefault<T>(this IAvaloniaApplication app, object key, T defaultValue = default)

Parameters

app IAvaloniaApplication

IAvaloniaApplication.

key object

Resource key.

defaultValue T

Default value.

Returns

T

Resource with given key and type, or default value.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.

TryFindResource<T>(IAvaloniaApplication, object, ThemeVariant?, out T?)

Try finding resource with given type.

public static bool TryFindResource<T>(this IAvaloniaApplication app, object key, ThemeVariant? theme, out T? res) where T : struct

Parameters

app IAvaloniaApplication

IAvaloniaApplication.

key object

Resource key.

theme ThemeVariant

Theme.

res T?

Found resource.

Returns

bool

True if resource found.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.

TryFindResource<T>(IAvaloniaApplication, object, ThemeVariant?, out T?)

Try finding resource with given type.

public static bool TryFindResource<T>(this IAvaloniaApplication app, object key, ThemeVariant? theme, out T? res) where T : class

Parameters

app IAvaloniaApplication

IAvaloniaApplication.

key object

Resource key.

theme ThemeVariant

Theme.

res T

Found resource.

Returns

bool

True if resource found.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.

TryFindResource<T>(IAvaloniaApplication, object, out T?)

Try finding resource with given type.

public static bool TryFindResource<T>(this IAvaloniaApplication app, object key, out T? res) where T : struct

Parameters

app IAvaloniaApplication

IAvaloniaApplication.

key object

Resource key.

res T?

Found resource.

Returns

bool

True if resource found.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.

TryFindResource<T>(IAvaloniaApplication, object, out T?)

Try finding resource with given type.

public static bool TryFindResource<T>(this IAvaloniaApplication app, object key, out T? res) where T : class

Parameters

app IAvaloniaApplication

IAvaloniaApplication.

key object

Resource key.

res T

Found resource.

Returns

bool

True if resource found.

Type Parameters

T

Type of resource.

Remarks

This is a thread-safe method.