ResourceMap.GetValue Method

Definition

Overloads

GetValue(String)

Note

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

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

GetValue(String, ResourceContext)

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

GetValue(String)

Note

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

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

C#
[Windows.Foundation.Metadata.Deprecated("GetValue(string) may be altered or unavailable for releases after Windows 8.1. Instead, use GetValue(string, ResourceContext).", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Overload("GetValue")]
public ResourceCandidate GetValue(string resource);
C#
[Windows.Foundation.Metadata.Overload("GetValue")]
[Windows.Foundation.Metadata.Deprecated("GetValue(string) may be altered or unavailable for releases after Windows 8.1. Instead, use GetValue(string, ResourceContext).", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public ResourceCandidate GetValue(string resource);
C#
[Windows.Foundation.Metadata.Overload("GetValue")]
public ResourceCandidate GetValue(string resource);

Parameters

resource
String

A resource identifier specified as a name or reference. For details, see the remarks for ResourceMap class.

Returns

A ResourceCandidate that describes the most appropriate candidate.

Attributes

See also

Applies to

WinRT Build 26100 and other versions
Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

GetValue(String, ResourceContext)

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

C#
[Windows.Foundation.Metadata.Overload("GetValueForContext")]
public ResourceCandidate GetValue(string resource, ResourceContext context);

Parameters

resource
String

A resource specified as a name or reference. For details, see the remarks for ResourceMap class.

context
ResourceContext

The context for which to select the most appropriate candidate.

Returns

A ResourceCandidate that describes the most appropriate candidate.

Attributes

Remarks

Some resources are loaded according to the scale of the view where they will be displayed, and different views within an app might be displayed on different devices with different scales. Scale is a per-view characteristic.

Since the GetValue method selects the best candidate for the specified resource in relation to a runtime context, and since the scale qualifier of a ResourceContext depends on the associated view, GetValue should always be called with a ResourceContext object obtained from the view in which the resource will be used. Call ResourceContext.GetForCurrentView to retrieve the appropriate ResourceContext.

See also

Applies to

WinRT Build 26100 and other versions
Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100