Share via


CustomXamlResourceLoader.GetResource(String, String, String, String) Method

Definition

When overridden in a derived class, specifies the logic of resource lookup for this CustomXamlResourceLoader. Given a resource ID and some type information about the expected result, returns the requested resource.

protected:
 virtual Platform::Object ^ GetResource(Platform::String ^ resourceId, Platform::String ^ objectType, Platform::String ^ propertyName, Platform::String ^ propertyType) = GetResource;
IInspectable GetResource(winrt::hstring const& resourceId, winrt::hstring const& objectType, winrt::hstring const& propertyName, winrt::hstring const& propertyType);
protected virtual object GetResource(string resourceId, string objectType, string propertyName, string propertyType);
function getResource(resourceId, objectType, propertyName, propertyType)
Protected Overridable Function GetResource (resourceId As String, objectType As String, propertyName As String, propertyType As String) As Object

Parameters

resourceId
String

Platform::String

winrt::hstring

The string-form key of the resource to get.

objectType
String

Platform::String

winrt::hstring

The expected type of the resource.

propertyName
String

Platform::String

winrt::hstring

The name of the property that serves as the key in the custom resource lookup logic.

propertyType
String

Platform::String

winrt::hstring

The type of the property that serves as the key, with type represented as a string.

Returns

Object

Platform::Object

IInspectable

The retrieved resource.

Remarks

This method will be called by the Windows Runtime XAML parser whenever it encounters a {CustomResource} markup extension usage in markup. The resourceId comes from the default key markup extension argument to {CustomResource} markup extension, and the other input parameters come from context, such as which property the usage is applied to.

Applies to