FrameworkElementExtensions.FindResource(FrameworkElement, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a WPF compatible version of FindResource to provide a static resource lookup. If the key is not found in the current element's resources, the logical tree is then searched element-by-element to look for the resource in each element's resources. If none of the elements contain the resource, the Application's resources are then searched.
See: https://docs.microsoft.com/dotnet/api/system.windows.frameworkelement.findresource.
public static object FindResource (this Windows.UI.Xaml.FrameworkElement element, object resourceKey);
static member FindResource : Windows.UI.Xaml.FrameworkElement * obj -> obj
<Extension()>
Public Function FindResource (element As FrameworkElement, resourceKey As Object) As Object
Parameters
- element
- Windows.UI.Xaml.FrameworkElement
The Windows.UI.Xaml.FrameworkElement to start searching for the target resource.
- resourceKey
- Object
The resource key to search for.
Returns
The requested resource.
Exceptions
Thrown when no resource is found with the specified key.