ResourceMap.GetValue メソッド

定義

オーバーロード

GetValue(String)

注意

getValue(String) は、Windows 8.1後にリリースで変更されたり、使用できなくなったりする場合があります。 代わりに、 GetValue(String, ResourceContext) を使用します

既定のコンテキスト内でリソース識別子によって指定されたリソースの最も適切な候補を返します。

GetValue(String, ResourceContext)

指定されたコンテキストのリソース識別子によって指定されたリソースの最も適切な候補を返します。

GetValue(String)

注意

getValue(String) は、Windows 8.1後にリリースで変更されたり、使用できなくなったりする場合があります。 代わりに、 GetValue(String, ResourceContext) を使用します

既定のコンテキスト内でリソース識別子によって指定されたリソースの最も適切な候補を返します。

public:
 virtual ResourceCandidate ^ GetValue(Platform::String ^ resource) = 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)]
/// [Windows.Foundation.Metadata.Overload("GetValue")]
ResourceCandidate GetValue(winrt::hstring const& resource);
/// [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")]
ResourceCandidate GetValue(winrt::hstring const& resource);
/// [Windows.Foundation.Metadata.Overload("GetValue")]
ResourceCandidate GetValue(winrt::hstring const& resource);
[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);
[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);
[Windows.Foundation.Metadata.Overload("GetValue")]
public ResourceCandidate GetValue(string resource);
function getValue(resource)
Public Function GetValue (resource As String) As ResourceCandidate

パラメーター

resource
String

Platform::String

winrt::hstring

名前または参照として指定されたリソース識別子。 詳細については、 ResourceMap クラスの解説を参照してください。

戻り値

最も適切な候補を記述する ResourceCandidate

属性

こちらもご覧ください

適用対象

GetValue(String, ResourceContext)

指定されたコンテキストのリソース識別子によって指定されたリソースの最も適切な候補を返します。

public:
 virtual ResourceCandidate ^ GetValue(Platform::String ^ resource, ResourceContext ^ context) = GetValue;
/// [Windows.Foundation.Metadata.Overload("GetValueForContext")]
ResourceCandidate GetValue(winrt::hstring const& resource, ResourceContext const& context);
[Windows.Foundation.Metadata.Overload("GetValueForContext")]
public ResourceCandidate GetValue(string resource, ResourceContext context);
function getValue(resource, context)
Public Function GetValue (resource As String, context As ResourceContext) As ResourceCandidate

パラメーター

resource
String

Platform::String

winrt::hstring

名前または参照として指定されたリソース。 詳細については、 ResourceMap クラスの解説を参照してください。

context
ResourceContext

最も適切な候補を選択するコンテキスト。

戻り値

最も適切な候補を記述する ResourceCandidate

属性

注釈

一部のリソースは、表示されるビューのスケールに応じて読み込まれ、アプリ内の異なるビューが異なるスケールの異なるデバイスに表示される場合があります。 スケールはビューごとの特性です。

GetValue メソッドはランタイム コンテキストに関連して指定されたリソースの最適な候補を選択するため、 ResourceContext のスケール修飾子は関連付けられたビューに依存するため、GetValue は常に、リソースが使用されるビューから取得した ResourceContext オブジェクトを使用して呼び出す必要があります。 ResourceContext.GetForCurrentView を呼び出して、適切な ResourceContext を取得します。

こちらもご覧ください

適用対象