Edit

Share via


AttachedShadowElementContext.TryGetResource<T>(String, T) Method

Definition

Retrieves a resource with the specified key and type if it exists

public bool TryGetResource<T> (string key, out T resource);
member this.TryGetResource : string * 'T -> bool
Public Function TryGetResource(Of T) (key As String, ByRef resource As T) As Boolean

Type Parameters

T

The type of the resource being retrieved.

Parameters

key
String

Key to use to lookup the resource.

resource
T

Object to retrieved from the resource dictionary or default value.

Returns

True if the resource exists, false otherwise

Applies to