Tries to find the resource in the ResourceDictionaries of the control and its ancestors.

Namespace: yWorks.Support.Windows
Assembly: yWorks.yFilesSilverlight.Viewer (in yWorks.yFilesSilverlight.Viewer.dll) Version: 2.4.0.0

Syntax

C#
public static Object TryFindResource( this Control element, Object resourceKey )
Visual Basic
<ExtensionAttribute> _ Public Shared Function TryFindResource ( _ element As Control, _ resourceKey As Object _ ) As Object

Parameters

element
Type: System.Windows.Controls..::..Control
The element to start searching for.
resourceKey
Type: System..::..Object
The resource key to use as the key.

Return Value

The result or nullNothingnullptra null reference (Nothing in Visual Basic).

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Control. 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