Udostępnij za pośrednictwem


ResourceLoader Constructors

Definition

Overloads

ResourceLoader()

Note

ResourceLoader() may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView().

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

Equivalent WinUI 2 API for UWP: ResourceLoader() (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

ResourceLoader(String)

Note

ResourceLoader(String) may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView(String).

Constructs a new ResourceLoader object for the specified ResourceMap.

Equivalent WinUI 2 API for UWP: ResourceLoader(String) (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

ResourceLoader()

Note

ResourceLoader() may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView().

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

Equivalent WinUI 2 API for UWP: ResourceLoader() (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

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

Remarks

The empty constructor typically allows access relative to a resource file's named resources (resources.resjson or resources.resw).

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

See also

Applies to

ResourceLoader(String)

Note

ResourceLoader(String) may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView(String).

Constructs a new ResourceLoader object for the specified ResourceMap.

Equivalent WinUI 2 API for UWP: ResourceLoader(String) (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

public:
 ResourceLoader(Platform::String ^ name);
/// [Windows.Foundation.Metadata.Deprecated("ResourceLoader may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
 ResourceLoader(winrt::hstring const& name);
/// [Windows.Foundation.Metadata.Deprecated("ResourceLoader may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
 ResourceLoader(winrt::hstring const& name);
 ResourceLoader(winrt::hstring const& name);
[Windows.Foundation.Metadata.Deprecated("ResourceLoader may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
public ResourceLoader(string name);
[Windows.Foundation.Metadata.Deprecated("ResourceLoader may be altered or unavailable for releases after Windows 8.1. Instead, use GetForCurrentView.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public ResourceLoader(string name);
public ResourceLoader(string name);
function ResourceLoader(name)
Public Sub New (name As String)

Parameters

name
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 named resource path. For example, "Foo?3" is treated as "Foo".

Attributes

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.

See also

Applies to