uwp

Topics related to uwp:

Getting started with uwp

This section provides an overview of what uwp is, and why a developer might want to use it.

It should also mention any large subjects within uwp, and link out to the related topics. Since the Documentation for uwp is new, you may need to create initial versions of those related topics.

UWP Hello World

UWP background tasks

  • For registering a background task that runs in a seperate process, you have to go to the "Declarations" Tab in the Package.appxmanifest and add a new "Background Task" and set the entry point.
  • Registering a single-process background task can be done by means of BackgroundTaskBuilder, but the application will throw an exception if you register a task twice, so you must check if you have already registered a task.
  • The app must gain authority to register a new task, this can be done by calling BackgroundExecutionManager.RequestAccessAsync(), but make sure that you really have the permission. The call returns the type of access (BackgroundAccessStatus enum) which will indicate whether you have access or not.
  • Tasks registered are kept until the package is uninstalled, but it won't hurt to check the tasks you need on every launch, bug happens!
  • When the application is updated, permission to register a new task is revoked. To keep your app running after an update, especially if you have added a new task register, you have to remove and request the access over, by means of BackgroundAccessManager. One method to know if your app is updated, is to register another task with a SystemTrigger, type of SystemTriggerType.ServicingComplete.

Device Families

Binding vs x:Bind

Images

Settings and app data

WebView navigation

All examples that fetch data from a remote URL, has to have "Internet (client)" capability checked in the Package.appxmanifest. For examples that only manipulate local data it's not necessary.

Binding vs x:Bind

Adaptive UI

Working with Filesystem

WebView

Images

File name qualifiers

Qualifiers are used in this common format:

Files: filename.qualifier-value.ext
~ multiple qualifiers: filename.qualifier1-value1_qualifier2-value2_....ext

Qualified folders: qualifier-value
~ multiple qualifiers: qualifier1-value1_qualifier2-value2_...

Qualifiers are listed bellow, they are used in the format described above

QualifierUsageValues
Lang / LanguageSpecifies a language, region or both.XX-XX, or XX values in BCP-47
ScaleQualifies the device scale factor.Commonly 100 / 125 / 150 / 200 / 400
DeviceFamilySpecifies the device type.Mobile / Team / Desktop / IoT
ContrastSpecifies the contrast theme type.Standard / High / Black / White
HomeRegionSpecifies user's home region.Any ISO3166-1 alpha2 or numeric code
TargetSizeGives the smallest image larger than need.Any positive integer.
LayoutDirSpecifies a layout direction.RTL / LTR / TTBRTL / TTBLTR
ConfigQualifies for MS_CONFIGURATION_ATTRIBUTE_VALUE.The value of environment config.
DXFL*Specifies a DirectX feature level.DX9 / DX10 / DX11

* Also used as DXFeatureLevel.

Some notes to keep in mind:

  • HomeRegion won't accept groupings or unions.
  • TargetSize and Scale cannot be used together.

Theme Resources

Application Lifecycle

Navigation

Unit Testing for UWP

Convert image size and crop image file in Windows Universal app

How to get current DateTime in C++ UWP

Resources in UWP (StaticResource / ThemeResource) and ResourceDictionary

Using JavaScript in WebView