Share via


ResourceLoader Constructors

Definition

Overloads

ResourceLoader()

Constructs a new ResourceLoader object for the "Resources" subtree of the currently running app's main ResourceMap.

ResourceLoader(String)

Constructs a new ResourceLoader object for the specified ResourceMap.

ResourceLoader(String, String)

Creates a ResourceLoader for the given context and map.

ResourceLoader()

Constructs a new ResourceLoader object for the "Resources" subtree of the currently running app's main ResourceMap.

public:
 ResourceLoader();
 ResourceLoader();
public ResourceLoader();
function ResourceLoader()
Public Sub New ()

Remarks

The empty constructor typically allows access relative to a resource file's resources.

This constructor fails with an exception if the main ResourceMap does not have a "Resources" subtree.

Applies to

ResourceLoader(String)

Constructs a new ResourceLoader object for the specified ResourceMap.

public:
 ResourceLoader(Platform::String ^ fileName);
 ResourceLoader(winrt::hstring const& fileName);
public ResourceLoader(string fileName);
function ResourceLoader(fileName)
Public Sub New (fileName As String)

Parameters

fileName
String

Platform::String

winrt::hstring

The resource identifier of the ResourceMap that the new resource loader uses for unqualified resource references. It can then retrieve resources relative to those references.

Note

The resource identifier is treated as a Uniform Resource Identifier (URI) fragment, subject to Uniform Resource Identifier (URI) semantics. For example, "Caption%20" is treated as "Caption ". Do not use "?" or "#" in resource identifiers, as they terminate the resource path. For example, "Foo?3" is treated as "Foo".

Remarks

This constructor is typically used to access resources relative to a resource file with the specified resource identifier. For example, new ResourceLoader('Errors'); is relative to errors.resjson or errors.resw.

Applies to

ResourceLoader(String, String)

Creates a ResourceLoader for the given context and map.

public:
 ResourceLoader(Platform::String ^ fileName, Platform::String ^ resourceMap);
 ResourceLoader(winrt::hstring const& fileName, winrt::hstring const& resourceMap);
public ResourceLoader(string fileName, string resourceMap);
function ResourceLoader(fileName, resourceMap)
Public Sub New (fileName As String, resourceMap As String)

Parameters

fileName
String

Platform::String

winrt::hstring

The path and name of the file that should be used for the current context.

resourceMap
String

Platform::String

winrt::hstring

The resource identifier of the resourceMap used for unqualified resource references by the new ResourceLoader. The ResourceLoader can then retrieve resources relative to those references.

Applies to