Provides simplified access to app resources such as app UI strings.
Syntax
var resourceLoader = new Windows.ApplicationModel.Resources.ResourceLoader(string); var resourceLoader = new Windows.ApplicationModel.Resources.ResourceLoader();
Attributes
- ActivatableAttribute(NTDDI_WIN8)
- ActivatableAttribute(Windows.ApplicationModel.Resources.IResourceLoaderFactory, NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- StaticAttribute(Windows.ApplicationModel.Resources.IResourceLoaderStatics, NTDDI_WIN8)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The ResourceLoader class has these types of members:
Constructors
The ResourceLoader class has these constructors.
| Constructor | Description |
|---|---|
| ResourceLoader() | Constructs a new ResourceLoader object for the Resources subtree of the currently running app's main ResourceMap. |
| ResourceLoader(String) | Constructs a new ResourceLoader object for the specified ResourceMap. |
Methods
The ResourceLoader class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| GetString | Returns the most appropriate string value of a resource, specified by resource identifier, for the default ResourceContext of the currently running application. |
| GetStringForReference | Returns the most appropriate string value of a resource, specified as a Uri for a resource identifier, for the default ResourceContext of the currently running app. |
Examples
Use the ResourceLoader.GetString | getString method to get the string resource identified by "Farewell".
var loader = new Windows.ApplicationModel.Resources.ResourceLoader(); var text = loader.getString('Farewell');
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
|
|
Metadata |
|
See also
- Creating and retrieving resources in Windows Store apps
- Application resources and localization sample
Build date: 12/4/2012