-api-id | -api-type |
---|---|
M:Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView |
winrt method |
Gets a ResourceLoader object for the Resources subtree of the currently running app's main ResourceMap. This ResourceLoader uses a default context associated with the current view.
A resource loader for the Resources subtree of the currently running app's main ResourceMap.
This method allows access relative to a resource file named "resources" (resources.resjson or resources.resw). The ResourceLoader that is returned uses a default context associated with the current view.
The resource management system for UWP apps supports the tailoring of resources for scale. Starting in Windows 8.1, different views owned by an app are able to display simultaneously on different display devices that may use different scales. In this way, scale is a per-view characteristic.
A ResourceLoader has an implicit context that is used when ResourceLoader methods are used to retrieve a resource. Since a ResourceLoader has an implicit context, and since the scale qualifier of contexts is dependent on an associated view, a ResourceLoader must be associated with a particular view.
This method fails with an exception if it is called in a windowless thread, or if the main ResourceMap does not have a "resources" subtree.
See the example in ResourceLoader.