CustomXamlResourceLoader.GetResource method

Applies to Windows and Windows Phone

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.

Syntax


protected virtual object GetResource(
  string resourceId, 
  string objectType, 
  string propertyName, 
  string propertyType
)

Parameters

resourceId

Type: System.String [.NET] | Platform::String [C++]

The string-form key of the resource to get.

objectType

Type: System.String [.NET] | Platform::String [C++]

The expected type of the resource.

propertyName

Type: System.String [.NET] | Platform::String [C++]

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

propertyType

Type: System.String [.NET] | Platform::String [C++]

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

Return value

Type: System.Object [.NET] | Platform::Object [C++]

The retrieved resource.

Remarks

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

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Resources
Windows::UI::Xaml::Resources [C++]

Metadata

Windows.winmd

See also

CustomXamlResourceLoader

 

 

Show:
© 2014 Microsoft