Udostępnij za pośrednictwem


ResourceMap Class

Definition

A collection of related resources, typically either for a particular app package, or a resource file for a particular package.

public ref class ResourceMap sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.ApplicationModel.Resources.MrtContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class ResourceMap final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.ApplicationModel.Resources.MrtContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class ResourceMap
Public NotInheritable Class ResourceMap
Inheritance
Object Platform::Object IInspectable ResourceMap
Attributes

Remarks

Resource identifier syntax

Many methods of this class use resource identifiers as parameters. The resource identifier is treated as a Uniform Resource Identifier (URI) fragment, subject to Uniform Resource Identifier (URI) semantics. For example, GetValue("Caption%20") is treated as GetValue("Caption ").

Do not use "?" or "#" in resource identifiers, because they terminate the resource path evaluation. For example, "MyResource?3" is treated as "MyResource".

Properties

ResourceCount

Gets the number of resources in the ResourceMap.

Methods

GetSubtree(String)

Returns a ResourceMap that represents a part of another ResourceMap, typically used to access a particular resource file within an app package.

This method finds subtree, ancestor, sibling and cousin maps to this resource map, as well as top-level maps. It returns the resource map represented by a given resource map identifier, relative to this resource map. This method is typically used to make simpler references to a particular subset of resources, such as a single resource file, or a directory of files.

GetValue(String, ResourceContext)

Returns the most appropriate candidate for a resource that is specified by a resource identifier for the supplied context.

GetValue(String)

Returns the most appropriate candidate for a resource that is specified by a resource identifier within the default context.

GetValueByIndex(UInt32, ResourceContext)

Returns the resource at the specified index in the specified context.

GetValueByIndex(UInt32)

Returns the resource at the specified index in the default context.

TryGetValue(String, ResourceContext)

Tries to find the most appropriate candidate for a resource that is specified by a resource identifier for the supplied context.

TryGetValue(String)

Tries to find the most appropriate candidate for a resource that is specified by a resource identifier within the default context.

Applies to