ResourceLoader 클래스

정의

앱 UI 문자열과 같은 앱 리소스에 대한 간소화된 액세스를 제공합니다.

public ref class ResourceLoader sealed
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.ApplicationModel.Resources.MrtContract")]
/// [Windows.Foundation.Metadata.Activatable(Microsoft.Windows.ApplicationModel.Resources.IResourceLoaderFactory, 65536, "Microsoft.Windows.ApplicationModel.Resources.MrtContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.ApplicationModel.Resources.MrtContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ResourceLoader final
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.ApplicationModel.Resources.MrtCoreContract")]
/// [Windows.Foundation.Metadata.Activatable(Microsoft.Windows.ApplicationModel.Resources.IResourceLoaderFactory, 65536, "Microsoft.Windows.ApplicationModel.Resources.MrtCoreContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.ApplicationModel.Resources.MrtCoreContract, 65536)]
class ResourceLoader final
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.ApplicationModel.Resources.MrtContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Microsoft.Windows.ApplicationModel.Resources.IResourceLoaderFactory), 65536, "Microsoft.Windows.ApplicationModel.Resources.MrtContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.ApplicationModel.Resources.MrtContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ResourceLoader
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.ApplicationModel.Resources.MrtCoreContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Microsoft.Windows.ApplicationModel.Resources.IResourceLoaderFactory), 65536, "Microsoft.Windows.ApplicationModel.Resources.MrtCoreContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.ApplicationModel.Resources.MrtCoreContract), 65536)]
public sealed class ResourceLoader
function ResourceLoader(fileName, resourceMap)
Public NotInheritable Class ResourceLoader
상속
Object Platform::Object IInspectable ResourceLoader
특성

설명

ResourceLoader 개체는 간단한 API에 결합된 특정 ResourceMapResourceContext를 캡슐화합니다.

ResourceLoader를 가져올 때 특정 리소스 맵을 지정할 수 있습니다. 리소스 맵이 지정되지 않은 경우 ResourceLoader는 앱의 기본 리소스 맵의 "리소스" 하위 트리에 대한 액세스를 제공합니다.

일반적으로 리소스는 크기 조정 또는 기타 디스플레이 특성에 민감할 수 있습니다. 이러한 이유로 리소스 컨텍스트는 일반적으로 특정 뷰와 연결됩니다. ResourceLoader는 리소스 컨텍스트를 캡슐화하므로 ResourceLoader에도 적용됩니다.

  • 사용되지 않는 DisplayProperties 클래스 대신 DisplayInformation 클래스를 사용하여 현재 뷰의 배율 인수를 가져옵니다.
  • 요소의 명시적 너비와 높이를 설정하는 앱은 흐릿한 이미지를 표시하는 것 외에는 여전히 제대로 작동해야 합니다.

화면 크기 및 중단점도 참조하세요.

생성자

ResourceLoader()

현재 실행 중인 앱의 기본 ResourceMap의 "Resources" 하위 트리에 대한 새 ResourceLoader 개체를 생성합니다.

ResourceLoader(String)

지정된 ResourceMap에 대한 새 ResourceLoader 개체를 생성합니다.

ResourceLoader(String, String)

지정된 컨텍스트 및 맵에 대한 ResourceLoader 를 만듭니다.

메서드

GetDefaultResourceFilePath()

사용자 지정 경로가 지정되지 않은 경우 ResourceLoader 가 생성될 경로인 기본 리소스 파일 경로를 가져옵니다.

GetString(String)

리소스 식별자가 지정한 리소스의 가장 적절한 문자열 값을 반환합니다.

GetStringForUri(Uri)

현재 실행 중인 앱의 기본 ResourceContext 에 대해 URI(Uniform Resource Identifier) 리소스 식별자가 지정한 리소스의 가장 적절한 문자열 값을 반환합니다.

적용 대상