CustomXamlResourceLoader.GetResource(String, String, String, String) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在派生类中重写时,指定此 CustomXamlResourceLoader 的资源查找逻辑。 给定资源 ID 和有关预期结果的某些类型信息,则返回请求的资源。
protected:
virtual Platform::Object ^ GetResource(Platform::String ^ resourceId, Platform::String ^ objectType, Platform::String ^ propertyName, Platform::String ^ propertyType) = GetResource;
IInspectable GetResource(winrt::hstring const& resourceId, winrt::hstring const& objectType, winrt::hstring const& propertyName, winrt::hstring const& propertyType);
protected virtual object GetResource(string resourceId, string objectType, string propertyName, string propertyType);
function getResource(resourceId, objectType, propertyName, propertyType)
Protected Overridable Function GetResource (resourceId As String, objectType As String, propertyName As String, propertyType As String) As Object
参数
- resourceId
-
String
Platform::String
winrt::hstring
要获取的资源的字符串形式键。
- objectType
-
String
Platform::String
winrt::hstring
资源的预期类型。
- propertyName
-
String
Platform::String
winrt::hstring
用作自定义资源查找逻辑中的键的属性的名称。
- propertyType
-
String
Platform::String
winrt::hstring
用作键的属性的类型,类型表示为字符串。
返回
检索到的资源。
注解
每当在标记中遇到 {CustomResource} 标记扩展用法时,Windows 运行时 XAML 分析器都会调用此方法。 resourceId 来自默认键标记扩展参数到 {CustomResource} 标记扩展,其他输入参数来自上下文,例如将用法应用于哪个属性。