Language: HTML | XAML

Defining app resources (XAML)

Applies to Windows and Windows Phone

Purpose

This section contains how-to topics and guidelines for providing application resources such as files or strings.

Windows is used worldwide, on a variety of different machines and form factors. It is vital to design applications so that resources, such as strings and images, are separated from their code. This lets them be independently maintained and localized, and also customized for different scaling factors, accessibility options, and a myriad of other user and machine contexts.

App developers should separate resources from code, and use the resource management system in Windows to handle the selection of the most appropriate resources that best match a particular user's runtime environment. This enables:

  • The display of different resources based on different configurations and user settings for language, region, DPI, and other form factors.
  • Increasing the reach of your app to audiences that vary in culture, region, or language by providing resources tailored to each audience.
  • The ability to localize resources separately from the code, so that translators do not need to be able to compile your code. This minimizes the potential for bugs to be introduced during localization.
  • The ability to maintain the code separately from the content of the resources. This permits code to be fixed or enhanced in a single code base, with a minimum of risk of altering localized content.

There are two types of resources:

  • File resources are simply resources stored as files on disk (such as images, html, json files, and xml files).
  • Embedded resources are resources stored within some container Resource File (such as ResW and ResJSON).
In Windows file resources are deployed as loose files on disk, and string resources are compiled from their source files and embedded in a PRI file.

In this section

TopicDescription

Quickstart: Using file or image resources

You can add images and other file resources to your app, and reference those files from within your app.

Quickstart: Using string resources

Put string resources into resource files, and reference those strings from your code or markup.

How to name resources using qualifiers

You can name resources by using qualifiers. The qualifiers identify the context in which a version of a resource should be used.

How to load string resources

You can load string resources from objects such as resource files, libraries, controls, and Windows Store app packages and manifests.

How to load file resources

Learn to load file resources from various locations.

 

Related topics

Roadmap for Windows Runtime apps using C# or Visual Basic

 

 

Show:
© 2014 Microsoft