Share via


ResourceMap.GetValue メソッド

定義

オーバーロード

GetValue(String)

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

GetValue(String, ResourceContext)

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

GetValue(String)

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

public:
 virtual ResourceCandidate ^ GetValue(Platform::String ^ resource) = GetValue;
/// [Windows.Foundation.Metadata.Overload("GetValue")]
ResourceCandidate GetValue(winrt::hstring const& 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("GetValueWithContext")]
ResourceCandidate GetValue(winrt::hstring const& resource, ResourceContext const& context);
[Windows.Foundation.Metadata.Overload("GetValueWithContext")]
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 のスケール修飾子は関連付けられているビューに依存するため、リソースが使用されるビューから取得した ResourceContext オブジェクトを使用して GetValue を常に呼び出す必要があります。

適用対象