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
IAvaloniaApplicationkey
objectResource key.
theme
ThemeVariantTheme.
defaultValue
TDefault 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
IAvaloniaApplicationkey
objectResource key.
defaultValue
TDefault 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
IAvaloniaApplicationkey
objectResource key.
theme
ThemeVariantTheme.
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
IAvaloniaApplicationkey
objectResource key.
theme
ThemeVariantTheme.
res
TFound 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
IAvaloniaApplicationkey
objectResource 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
IAvaloniaApplicationkey
objectResource key.
res
TFound resource.
Returns
- bool
True if resource found.
Type Parameters
T
Type of resource.
Remarks
This is a thread-safe method.