TryFindResource(IResourceHost, Object, ThemeVariant, Object) Method
Tries to the specified resource by searching up the logical tree and then global styles.
Definition
Namespace: Avalonia.Controls
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static bool TryFindResource(
this IResourceHost control,
Object key,
ThemeVariant? theme,
out Object?? value
)
<ExtensionAttribute>
Public Shared Function TryFindResource (
control As IResourceHost,
key As Object,
theme As ThemeVariant,
<OutAttribute> ByRef value As Object
) As Boolean
[<ExtensionAttribute>]
static member TryFindResource :
control : IResourceHost *
key : Object *
theme : ThemeVariant *
value : Object byref -> bool
Parameters
- IResourceHost
- The control.
- Object
- The resource key.
- ThemeVariant
- Theme used to select theme dictionary.
- Object
- On return, contains the resource if found, otherwise null.
Return Value
Boolean
True if the resource was found; otherwise false.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IResourceHost. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also
Reference
ResourceNodeExtensions Class
TryFindResource Overload
Avalonia.Controls Namespace