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 的縮放限定詞相依于相關聯的檢視,因此應該一律使用從使用資源之檢視中取得的 ResourceCoNtext 物件來呼叫 GetValue。 呼叫 ResourceCoNtext.GetForCurrentView 以擷取適當的 ResourceCoNtext

另請參閱

適用於