Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 2.16 KB

resourceloader_getforcurrentview_1363600702.md

File metadata and controls

33 lines (22 loc) · 2.16 KB
-api-id -api-type
M:Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView
winrt method

Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView

-description

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.

-returns

A resource loader for the Resources subtree of the currently running app's main ResourceMap.

-remarks

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.

Errors

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.

-examples

See the example in ResourceLoader.

-see-also

GetForCurrentView(String)