121
Deeper Into Windows 10 Development Universal Windows Apps Shahed Chowdhuri Sr. Technical Evangelist @ Microsoft WakeUpAndCode.com

Deeper into Windows 10 Development

Embed Size (px)

Citation preview

Page 1: Deeper into Windows 10 Development

Deeper Into Windows 10 DevelopmentUniversal Windows Apps

Shahed ChowdhuriSr Technical Evangelist Microsoft WakeUpAndCodecom

AgendaQuick Overview

One WindowsMany devices

Windows 10 App DevelopmentBuild 2015MSDN Channel 9Microsoft Virtual Academy

DemosPublic projects from Github

Windows CoreThe refactored common coreOne hardware platformUniversal hardware driverStandard network and IO

PhoneDevice

XboxDevice

DesktopDevice

Windows Core

DesktopSKU

PhoneSKU

XboxSKU

One Windows

DesktopSKU

PC

2 in 1

MobileSKU

Tablet

Phablet

Phone

XboxSKU

Xbox

IoTSKU

Band

IoT headless

SKU

Raspberry Pi

Home Automati

on

Surface HubSKU

Surface Hub

HolographicSKU

HoloLens

Phone Small Tablet

2-in-1s(Tablet or Laptop)

Desktops amp All-in-OnesPhablet Large Tablet

Classic Laptop

Xbox IoTSurface Hub

Holographic

Windows 10

Multiple device families

PC XBoxMobile Surface Hub

HoloLensDevices +IoT

Universal Windows Apps

One Store +One Dev Center

Reuse Existing CodeOne SDK +

Tooling

Adaptive User Interface Natural

User Inputs

One Universal Windows Platform

Windows 10operating system

Bridging technologies

Win32

desktop

Webhosted

JavaAndroid

ObjCiOS

Universal Windows Platform

WWAC++amp CX

Netlanguages

HTMLDirectX

XAML

C++

Netlanguages

MFCWFWPF

Netruntime

Apps dont target Windows 10 apps target the platform

Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x

Platform WP 81+ WP 81 Win 81 Win 10

Device OS Build version targeting

Encryption (not yet)

App Bundles

Debug Package Signing

Differential DownloadUpdate

File Single Instancing

External Volume (SD) Installation (Win 10)

Shared publisher storage

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 2: Deeper into Windows 10 Development

AgendaQuick Overview

One WindowsMany devices

Windows 10 App DevelopmentBuild 2015MSDN Channel 9Microsoft Virtual Academy

DemosPublic projects from Github

Windows CoreThe refactored common coreOne hardware platformUniversal hardware driverStandard network and IO

PhoneDevice

XboxDevice

DesktopDevice

Windows Core

DesktopSKU

PhoneSKU

XboxSKU

One Windows

DesktopSKU

PC

2 in 1

MobileSKU

Tablet

Phablet

Phone

XboxSKU

Xbox

IoTSKU

Band

IoT headless

SKU

Raspberry Pi

Home Automati

on

Surface HubSKU

Surface Hub

HolographicSKU

HoloLens

Phone Small Tablet

2-in-1s(Tablet or Laptop)

Desktops amp All-in-OnesPhablet Large Tablet

Classic Laptop

Xbox IoTSurface Hub

Holographic

Windows 10

Multiple device families

PC XBoxMobile Surface Hub

HoloLensDevices +IoT

Universal Windows Apps

One Store +One Dev Center

Reuse Existing CodeOne SDK +

Tooling

Adaptive User Interface Natural

User Inputs

One Universal Windows Platform

Windows 10operating system

Bridging technologies

Win32

desktop

Webhosted

JavaAndroid

ObjCiOS

Universal Windows Platform

WWAC++amp CX

Netlanguages

HTMLDirectX

XAML

C++

Netlanguages

MFCWFWPF

Netruntime

Apps dont target Windows 10 apps target the platform

Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x

Platform WP 81+ WP 81 Win 81 Win 10

Device OS Build version targeting

Encryption (not yet)

App Bundles

Debug Package Signing

Differential DownloadUpdate

File Single Instancing

External Volume (SD) Installation (Win 10)

Shared publisher storage

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 3: Deeper into Windows 10 Development

Windows CoreThe refactored common coreOne hardware platformUniversal hardware driverStandard network and IO

PhoneDevice

XboxDevice

DesktopDevice

Windows Core

DesktopSKU

PhoneSKU

XboxSKU

One Windows

DesktopSKU

PC

2 in 1

MobileSKU

Tablet

Phablet

Phone

XboxSKU

Xbox

IoTSKU

Band

IoT headless

SKU

Raspberry Pi

Home Automati

on

Surface HubSKU

Surface Hub

HolographicSKU

HoloLens

Phone Small Tablet

2-in-1s(Tablet or Laptop)

Desktops amp All-in-OnesPhablet Large Tablet

Classic Laptop

Xbox IoTSurface Hub

Holographic

Windows 10

Multiple device families

PC XBoxMobile Surface Hub

HoloLensDevices +IoT

Universal Windows Apps

One Store +One Dev Center

Reuse Existing CodeOne SDK +

Tooling

Adaptive User Interface Natural

User Inputs

One Universal Windows Platform

Windows 10operating system

Bridging technologies

Win32

desktop

Webhosted

JavaAndroid

ObjCiOS

Universal Windows Platform

WWAC++amp CX

Netlanguages

HTMLDirectX

XAML

C++

Netlanguages

MFCWFWPF

Netruntime

Apps dont target Windows 10 apps target the platform

Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x

Platform WP 81+ WP 81 Win 81 Win 10

Device OS Build version targeting

Encryption (not yet)

App Bundles

Debug Package Signing

Differential DownloadUpdate

File Single Instancing

External Volume (SD) Installation (Win 10)

Shared publisher storage

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 4: Deeper into Windows 10 Development

One Windows

DesktopSKU

PC

2 in 1

MobileSKU

Tablet

Phablet

Phone

XboxSKU

Xbox

IoTSKU

Band

IoT headless

SKU

Raspberry Pi

Home Automati

on

Surface HubSKU

Surface Hub

HolographicSKU

HoloLens

Phone Small Tablet

2-in-1s(Tablet or Laptop)

Desktops amp All-in-OnesPhablet Large Tablet

Classic Laptop

Xbox IoTSurface Hub

Holographic

Windows 10

Multiple device families

PC XBoxMobile Surface Hub

HoloLensDevices +IoT

Universal Windows Apps

One Store +One Dev Center

Reuse Existing CodeOne SDK +

Tooling

Adaptive User Interface Natural

User Inputs

One Universal Windows Platform

Windows 10operating system

Bridging technologies

Win32

desktop

Webhosted

JavaAndroid

ObjCiOS

Universal Windows Platform

WWAC++amp CX

Netlanguages

HTMLDirectX

XAML

C++

Netlanguages

MFCWFWPF

Netruntime

Apps dont target Windows 10 apps target the platform

Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x

Platform WP 81+ WP 81 Win 81 Win 10

Device OS Build version targeting

Encryption (not yet)

App Bundles

Debug Package Signing

Differential DownloadUpdate

File Single Instancing

External Volume (SD) Installation (Win 10)

Shared publisher storage

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 5: Deeper into Windows 10 Development

Phone Small Tablet

2-in-1s(Tablet or Laptop)

Desktops amp All-in-OnesPhablet Large Tablet

Classic Laptop

Xbox IoTSurface Hub

Holographic

Windows 10

Multiple device families

PC XBoxMobile Surface Hub

HoloLensDevices +IoT

Universal Windows Apps

One Store +One Dev Center

Reuse Existing CodeOne SDK +

Tooling

Adaptive User Interface Natural

User Inputs

One Universal Windows Platform

Windows 10operating system

Bridging technologies

Win32

desktop

Webhosted

JavaAndroid

ObjCiOS

Universal Windows Platform

WWAC++amp CX

Netlanguages

HTMLDirectX

XAML

C++

Netlanguages

MFCWFWPF

Netruntime

Apps dont target Windows 10 apps target the platform

Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x

Platform WP 81+ WP 81 Win 81 Win 10

Device OS Build version targeting

Encryption (not yet)

App Bundles

Debug Package Signing

Differential DownloadUpdate

File Single Instancing

External Volume (SD) Installation (Win 10)

Shared publisher storage

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 6: Deeper into Windows 10 Development

Multiple device families

PC XBoxMobile Surface Hub

HoloLensDevices +IoT

Universal Windows Apps

One Store +One Dev Center

Reuse Existing CodeOne SDK +

Tooling

Adaptive User Interface Natural

User Inputs

One Universal Windows Platform

Windows 10operating system

Bridging technologies

Win32

desktop

Webhosted

JavaAndroid

ObjCiOS

Universal Windows Platform

WWAC++amp CX

Netlanguages

HTMLDirectX

XAML

C++

Netlanguages

MFCWFWPF

Netruntime

Apps dont target Windows 10 apps target the platform

Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x

Platform WP 81+ WP 81 Win 81 Win 10

Device OS Build version targeting

Encryption (not yet)

App Bundles

Debug Package Signing

Differential DownloadUpdate

File Single Instancing

External Volume (SD) Installation (Win 10)

Shared publisher storage

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 7: Deeper into Windows 10 Development

Windows 10operating system

Bridging technologies

Win32

desktop

Webhosted

JavaAndroid

ObjCiOS

Universal Windows Platform

WWAC++amp CX

Netlanguages

HTMLDirectX

XAML

C++

Netlanguages

MFCWFWPF

Netruntime

Apps dont target Windows 10 apps target the platform

Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x

Platform WP 81+ WP 81 Win 81 Win 10

Device OS Build version targeting

Encryption (not yet)

App Bundles

Debug Package Signing

Differential DownloadUpdate

File Single Instancing

External Volume (SD) Installation (Win 10)

Shared publisher storage

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 8: Deeper into Windows 10 Development

Apps dont target Windows 10 apps target the platform

Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x

Platform WP 81+ WP 81 Win 81 Win 10

Device OS Build version targeting

Encryption (not yet)

App Bundles

Debug Package Signing

Differential DownloadUpdate

File Single Instancing

External Volume (SD) Installation (Win 10)

Shared publisher storage

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 9: Deeper into Windows 10 Development

Windows store packagingFeature WP XAP 81 WP AppX 81 AppX 81 AppX 10x

Platform WP 81+ WP 81 Win 81 Win 10

Device OS Build version targeting

Encryption (not yet)

App Bundles

Debug Package Signing

Differential DownloadUpdate

File Single Instancing

External Volume (SD) Installation (Win 10)

Shared publisher storage

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 10: Deeper into Windows 10 Development

Windows store distribution

Windows Phone 7x 8x Windows 8x Windows 10

Hidden apps

Per market pricing

Independent IAP publishing

Betas flighting

Time based trials

App discounts

Scheduled publish

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 11: Deeper into Windows 10 Development

ConsiderationsBest practicesConsider ads during the design phaseShow video ads during natural breaksAssociate ads with real up-sides

Worst practicesShowing ads at app-startInterrupt the userrsquos workflowBack-to-back ads

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 12: Deeper into Windows 10 Development

In-app purchasesif DEBUG var license = CurrentAppSimulatorLicenseInformation if (licenseProductLicenses[AdFree]IsActive) already owns thisShowAds = false else var result = await CurrentAppSimulatorRequestProductPurchaseAsync(AdFree) switch (resultStatus) case ProductPurchaseStatusSucceeded case ProductPurchaseStatusAlreadyPurchased thisShowAds = false break default thisShowAds = true break else var license = CurrentAppLicenseInformation endif

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 13: Deeper into Windows 10 Development

The Windows store provides many ways to monetize your app

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 14: Deeper into Windows 10 Development

The XAML UI platformWindows is standardizingNew experiences like Start and File Explorer use the XAML UI platformThe operating system has tremendous performance requirements

Office is standardizingThe universal suite of Office apps use the XAML UI platformOffice has tremendous usability and feature requirements

First-party is standardizingNew and existing MSN apps for Windows use the XAML UI platformFirst party apps push the edge of API capability and availability

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 15: Deeper into Windows 10 Development

Blend the XAML developerrsquos IDEVisual Studio ShellXAML IntellisenseXAML PeekSync SettingsQuick launch

Classic BlendResourcesDataStoryboardsStatesBehaviors

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 16: Deeper into Windows 10 Development

App bars and commandsltAppBar gt

ltCommandBar gt

ltAppBarButton Label= Icon= gt

ltAppBarToggleButton IsChecked= gt

ltAppBarSeparator gt

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 17: Deeper into Windows 10 Development

The XAML UI platform is foundational to Windows

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 18: Deeper into Windows 10 Development

xBindCompiled bindingBindings are committed at compile-time

Strongly-typed bindingDuck binding is not supported

Default mode is OneTimeOneWay and TwoWay are still available

Standard binding approachesINotifyPropertyChanged IObservableVector INotifyCollectionChanged

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 19: Deeper into Windows 10 Development

SyntaxltTextBox Text=Binding

ConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltTextBox Text=xBindConverterConverterLanguageConverterParameterElementNameFallbackValueModePathRelativeSourceSourceTargetNullValueUpdateSourceTrigger

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 20: Deeper into Windows 10 Development

ltListView ItemsSource=xBind ViewModelEmployeesgt

ltListViewItemTemplategt

ltDataTemplate xDataType=modelEmployeegt

ltGridgt

ltTextBlock Text=xBind Namegt

ltGridgt

ltDataTemplategt

ltListViewItemTemplategt

ltListViewgt

Data Templates

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 21: Deeper into Windows 10 Development

When to use classic bindingDuck TypingText=ldquoBinding Agerdquo works for both PersonModel amp WineModel

Dictionary graphsUse Binding with JSON or other untyped objects

Code-behind bindingCan addremove xBind runtime

Use in a stylexBind canrsquot be used in a style for settersxBind can be used in a DataTemplate that is defined in the style

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 22: Deeper into Windows 10 Development

xBind can meet your binding needs most of the time

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 23: Deeper into Windows 10 Development

StartupMemory

Benefits on the universal platform

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 24: Deeper into Windows 10 Development

xPhase amp progressive renderingltDataTemplate xDataType=modelFileItemgt

ltGrid Width=200 Height=80gt

ltTextBlock Text=xBind DisplayName gt

ltTextBlock Text=xBind prettyDate xPhase=1gt

ltGridgt

ltDataTemplategt

Some guidancePhase 0 is the defaultOnly a few manageable phasesPhase numbers dont need to be contiguous

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 25: Deeper into Windows 10 Development

Understanding deferralReduce the number of elements at startupDeclare the UIElement-derived items (or containers) you dont want rendered

4 ways to realize an element1 FindName()2 EnsureElementRealized()3 GetTemplatedChild() (for ControlTemplate)4 Storyboard amp VisualStates (because of FindName)

Nothing is freeA lightweight proxy element is createdEvents are hooked up after realizedBinding is completed after realized (including xBind)

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 26: Deeper into Windows 10 Development

xDefer exampleltStackPanel xName=AdditionalProductPage Visibility=Collapsed xDeferLoadStrategy=Lazygt lt-- so much stuff --gt ltStackPanelgt

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 27: Deeper into Windows 10 Development

The fastest codeis the code you dont run

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 28: Deeper into Windows 10 Development

Adaptive controls

>
>

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 29: Deeper into Windows 10 Development

Input intelligence

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 30: Deeper into Windows 10 Development

Scaling algorithm

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 31: Deeper into Windows 10 Development

As you design1 Adapt to size change

2 Adapt to input change

3 Build with effective pixels

4 Count on the scaling algorithm

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 32: Deeper into Windows 10 Development

Adapt to different devices without targeting each and every device

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 33: Deeper into Windows 10 Development

Visual StatesDefine XAML viewsUnique layout for distinct states

Simplify animationAutomatically implement state transitions

Build in BlendDesign and preview states and transitions

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 34: Deeper into Windows 10 Development

How to set the visual stateVisualStateManagerGoto(element state transition)public MainPage() thisInitializeComponent() thisSizeChanged += (s e) =gt var state = VisualState000min if (eNewSizeWidth gt 1000) state = VisualState1000min else if (eNewSizeWidth gt 800) state = VisualState800min else if (eNewSizeWidth gt 500) state = VisualState500minVisualStateManagerGoToState(this state true)

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 35: Deeper into Windows 10 Development

Adaptive triggersCode-free state transition

Two built-in triggersMinWindowHeight (Taller than this)MinWindowWidth (Wider than this)

ltVisualState xName=VisualState500mingt ltVisualStateStateTriggersgt ltAdaptiveTrigger MinWindowWidth=501 gt ltVisualStateStateTriggersgtltVisualStategt

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 36: Deeper into Windows 10 Development

Custom adaptive triggersBuild to handle special casespublic class DeviceFamilyTrigger StateTriggerBase private string _deviceFamily public string DeviceFamily get return _deviceFamily set var qualifiers = WindowsApplicationModelResourcesCore ResourceContextGetForCurrentView()QualifierValues if (qualifiersContainsKey(DeviceFamily)) SetActive(qualifiers[DeviceFamily] == (_deviceFamily = value)) else SetActive(false)

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 37: Deeper into Windows 10 Development

Developers have many toolsto build an adaptive UI

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 38: Deeper into Windows 10 Development

What are Adaptive AppsWindows apps adapt to different versions of the platform

Windows apps adapt to different types of devices

Windows apps adapt to different screen sizes

Adaptive UI handles different screens

Adaptive Code can light up your app to conditionally execute code only when running on specific device families andor particular versions of platformextension APIsConditionally take advantage of unique device capabilitiesUse newer APIs while still supporting down-level clients

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 39: Deeper into Windows 10 Development

Windows 81 Universal Shared code two binaries

WindowsBinary Phone

Binary

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 40: Deeper into Windows 10 Development

Declare Device Family DependenciesDependency on a single device familyltDependenciesgt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

On more than oneltDependenciesgt ltTargetDeviceFamily Name=WindowsDesktop minVersion=100100690 maxVersionTested=10500 gt ltTargetDeviceFamily Name=WindowsUniversal minVersion=100100690 maxVersionTested=10500 gtltDependenciesgt

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 41: Deeper into Windows 10 Development

Extension SDKs

UWP

Windows Core Windows Core Windows Core Windows Core

UWP UWP UWP

Desktop Mobile Xbox Morehellip

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 42: Deeper into Windows 10 Development

The device families you choose determines which APIs you can call freely

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 43: Deeper into Windows 10 Development

Locations where apps can access data

App

App Package Folder

ro

App data Folders

rwApp data FoldersApp data

Folders

Local

RoamingTemp

Removable

Storage (SD Card)

rw

Known Folders

PicturesVideosMusic- Direct access needs manifest capabilities

rw

Cloud

rw

File Syste

m

File OpenSave Picker

APIs

rw

Credential Locker

rwBground Transfer

Publishers Shared Folder

rw

AppApp

Picker Provider apps

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 44: Deeper into Windows 10 Development

Package and App Data FoldersPackage Manager installs all app files into the App package Folder

Read-only access from app

Apps store data in Local Folder

Settings and properties in the app settings dictionaries

Data in files

Structured data in database files

Local or Roaming

Settings File

App CreatesManagesfiles and settings

ApplicationFiles

App Data Folder

Creates root folder

sandboxed to App

Package Manager

App Package Folder

WinRT Storage APIs

Install

DB

Database file

DB Files (ro)

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 45: Deeper into Windows 10 Development

Directly Accessible RW Data Storage

RoamingFolde

rSettin

gs

bull Other devices can access what you put in here

bull Data roamed cross-device

bull Limited to 100KB per application

bull Held in OneDrive storage

LocalFolde

rSetting

s

bull Store local data here for use by your application

bull Can store data up to the limit of the storage on the device

bull Retained if the application is updated

TempFolde

r

bull Use for temporary storage

bull No guarantee it will still be here next time your program runs

bull Cleaned up in a low storage condition

WindowsStorageApplicationData WindowsSecurity

Credentials

PasswordVaultCredenti

als

bull Credential Locker

bull Use for secure storage of PasswordCred-ential objects

bull Data roamed cross-device

Publisher CacheFolde

r

bull Shared storage for apps from same publisher

bull Declare in app manifest

New

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 46: Deeper into Windows 10 Development

KnownFoldersPhysical View Logical View

CUsersPublicPicturesSeattle

DPicturesPortland

DPicturesBirthday

CUsersPublicPicturesBirthdayCUsersPublicPicturesPic01jpg

DPicturesPic01jpg

Internal storage

SD Card (if present)

KnownFoldersPicturesLibraryGetFilesAsync()

DPicturesPic02jpg

DPicturesHawaiiPic02jpg

StorageFile Pic01jpg

StorageFile Pic01jpg

StorageFile Pic02jpg

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 47: Deeper into Windows 10 Development

Provide multiple options for the user to loadsave data

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 48: Deeper into Windows 10 Development

Why SQLiteWorldsrsquo most popular databasebull Widely used on iOS Android Python Mono etchellipbull Public Domainbull Small Fast Reliable

Rich Featuresbull Embedded SQL in-process database enginebull Readwrites to ordinary disk filesbull Supports multiple tables indices triggers and viewsbull Cross-platform ndash freely copy database files between 32-bit and 64-bit or little endian

and big endian

Reliablebull Reputation for being very reliablebull Large automated test suitebull All transactions are ACID even if interrupted by system crashes or power failures

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 49: Deeper into Windows 10 Development

Choice of NET APIsSQLite-NETLINQ syntaxLightweight ORM

SQLitePCLSQL statementsThin wrapper around the SQLite C API

using (var conn = new SQLiteConnection(demodb)) Customer customer = null

using (var statement = connPrepare( SELECT Id Name FROM Customer WHERE Id = ))

statementBind(1 customerId) if (SQLiteResultDONE == statementStep())

customer = new Customer() Id = (long)statement[0] Name = (string)statement[1]

var db = new SQLiteSQLiteAsyncConnection(AppDBPath)

var _customer = await (from c in dbTableltCustomergt() where cId == customerId select c)FirstOrDefaultAsync()

if (customer = null) var Id = _customerId var Name = _customerName

hellipand others

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 50: Deeper into Windows 10 Development

Installing the SQLite LibraryVisual Studio Extension (vsix)

Install from Visual StudioTools ndash Extensions and Updateshellip

Or download from SQLiteorg

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 51: Deeper into Windows 10 Development

Installing SQLitePCL to your Solution

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 52: Deeper into Windows 10 Development

Frameworks that use SQLiteEntity Framework 7Azure App Service

Mobile Apps

Easy to implement offline data sync uses SQLite for local data storage

01010001001011000100

Lightweight ORM Supports offline data sync using SQLite for local data storageSee BUILD session 2-693 Entity Framework 7httpchannel9msdncomEventsBuild20152-693

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 53: Deeper into Windows 10 Development

SQLite provides a convenient option for your app

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 54: Deeper into Windows 10 Development

Enhanced App to App in Windows 10

Send file token send data

Launch a specific app

App Services

Launch for Results

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 55: Deeper into Windows 10 Development

URI Activation++

Invoke a specific app

var options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options)

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 56: Deeper into Windows 10 Development

URI Activation++

Send Filesvar options = new LauncherOptions()optionsTargetApplicationPackageFamilyName = 24919InstapaperIt

var token = SharedStorageAccessManagerAddFile (gpxFile)

ValueSet inputData = new ValueSet()inputDataAdd(Token token)

var launchUri = new Uri(instapaperAddUrl=http3A2F2Fbingcom)await LauncherLaunchUriAsync(launchUri options inputData)

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 57: Deeper into Windows 10 Development

Query URI Support

Discover if app already installed to handle a Uri

var queryUri = new Uri(instapaper)await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUri)

var queryUri = new Uri(instapaper)string packageFamilyName = 24919InstapaperIt await LauncherQueryUriSupportAsync(queryUri LaunchUriTypeLaunchUriForResults packageFamilyName)

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 58: Deeper into Windows 10 Development

App Services

Covered in separate module

Client App A

Client App B Background Task

App with App Service

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 59: Deeper into Windows 10 Development

Apps on Windows 10 can communicate in new ways

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 60: Deeper into Windows 10 Development

String resources project StringsOff the root this is a convention

project Stringsen-USMatching the local identifier

project Stringsen-USResourcesreswResource file with localized strings

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 61: Deeper into Windows 10 Development

Resource loaderAccess strings directlyDialogs errors validate

async void Alert(string messageId) var loader = WindowsApplicationModelResourcesResourceLoaderGetForCurrentView() var title = loaderGetString(stringFormat(0Title messageId)) var message = loaderGetString(stringFormat(0Message messageId)) var button = loaderGetString(stringFormat(0Button messageId)) var dialog = new ContentDialog Title = title Content = message PrimaryButtonText = button await dialogShowAsync()

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 62: Deeper into Windows 10 Development

Multilingual app toolkitSupport for XLF (version 12) filesTypical format for custom translation houses

Inside Visual StudioMicrosoft translator service (machine learning)Microsoftrsquos professionally translated strings (originally built for Office)

Outside Visual StudioFree community tool

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 63: Deeper into Windows 10 Development

Localizing your app will help you succeed in more regions amp locales

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 64: Deeper into Windows 10 Development

App Lifecycle

Runningapp

Suspendedapp

Suspending Terminatedapp

Low memory

Resuming

Background task executes

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 65: Deeper into Windows 10 Development

Handling suspension

public App() thisInitializeComponent()

thisSuspending += (s e) =gt Save data

thisResuming += (s e) =gt Load data

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 66: Deeper into Windows 10 Development

Extended executionRequesting extended executionThere is no guarantee resources are availableExtended execution has no UI

Scenario ldquoI have data this timerdquoHandle the Revoked event (1 second warning)

Scenario ldquoIrsquom a special kind of apprdquoThese apps run indefinitely

Special kinds of apps1Turn-by-turn (location tracking) app2Audio amp VOIP application

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 67: Deeper into Windows 10 Development

Requesting extension in suspendprivate async void OnSuspending(object sender SuspendingEventArgs args)

var deferral = eSuspendingOperationGetDeferral() using (var session = new ExtendedExecutionSession Reason = ExtendedExecutionReasonSavingData ) sessionDescription = Upload Data sessionRevoked += (s e) =gt Log(Save incomplete)

try if (await sessionRequestExtensionAsync() == ExtendedExecutionResultDenied) takes 3 seconds UploadBasicData() else takes 8 seconds await UploadDataAsync(session) Log(Save complete) catch Log(Save failed) finally deferralComplete()

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 68: Deeper into Windows 10 Development

Understanding the App Life Cycle facilitates a smoother experience

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 69: Deeper into Windows 10 Development

Building a background taskRespect costBackgroundWorkCostValueHigh means the task should not do work

Handling cancelationTasks can be cancelled by the app or operating system heuristics

Running in deferralBackground tasks do not have to operate asynchronously

Progress feedbackProgress is a numeric value

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 70: Deeper into Windows 10 Development

Request Background Permission

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 71: Deeper into Windows 10 Development

System condition(s) [ if ]User Present

If the user is present

User Not PresentIf the user is not present

Internet AvailableIf the internet is available

Internet Not Available

If the internet is not available

Session ConnectedIf the user is logged in

Session DisconnectedIf the user is not logged in

Free Network AvailableIf a non-metered network is available

Work Cost Not HighIf background resources are plentiful

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 72: Deeper into Windows 10 Development

Host tasks in foreground processtt

In-processSimplified communicationShares memory caps

Foreground app starts in appexeBackground task starts in appexe

Default processHosted in separate processSeparate memory cap

Default process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

In process

appexe

CoreApplication

BackgroundTask

backgroundtaskhostexe

App Container

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 73: Deeper into Windows 10 Development

Background tasks can extend capabilities of your app

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 74: Deeper into Windows 10 Development

App Services

Client App A

Client App B

Background Task

App with App Service

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 75: Deeper into Windows 10 Development

Scenario Bar Code Scanning

Bar Code decoding App

ServiceImage bytes in ValueSet or FileToken

Decoded data

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 76: Deeper into Windows 10 Development

Scenario Enterprise suite of apps

App ServiceMaintains Inventory

cache

Client App A

Client App B

Interact with cloud services

App ServiceProximity Reading

Services

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 77: Deeper into Windows 10 Development

Can I restrict access to my App ServiceBuild your own caller validation mechanisms on top of app services

Simplest is for service provider to whitelist callers based on their PackageFamilyNamePackageFamilyName of caller is passed with every request

Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been establishedWhitelist could be followed by explicit X509 certificate exchange

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 78: Deeper into Windows 10 Development

App services provides another way for applications to communicate with each other

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 79: Deeper into Windows 10 Development

12

Always up-to-dateUpdate frequentlySingle doc model

Always up-to-dateUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Firefox

Chrome

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 80: Deeper into Windows 10 Development

Ever Green EngineUpdate frequentlySingle doc model

Ever Green EngineUpdate frequentlySingle doc model

13

34

14

35

Q

5

7

8

9

E

10

11

Always up-to-dateUpdate frequentlySingle doc model

Firefox

Chrome

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 81: Deeper into Windows 10 Development

User-Agent Strings

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome390217171 Safari53736 Edge120

Mozilla50 (Macintosh Intel Mac OS X 10_10_1) AppleWebKit600125 (KHTML like Gecko) Version80 Safari600125

Mozilla50 (Windows NT 100 WOW64) AppleWebKit53736 (KHTML like Gecko) Chrome400221493 Safari53736

Mozilla50 (Windows NT 100 WOW64 rv350) Gecko20100101 Firefox350

Chrome

Safari

Firefox

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 82: Deeper into Windows 10 Development

EdgeHTMLdll Chakra

Hosted contentAlways up-to-date

Packaged contentOffline first

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 83: Deeper into Windows 10 Development

Edge enables a better webapp experience

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 84: Deeper into Windows 10 Development

Mobile Experiences - not just mobile devices

User is the center of the experience not the device

Available on the right device at the right time

Input model optimized for the experience

Enabling Mobile Experiences with Universal Apps

The Experience you want on the device you want

User

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 85: Deeper into Windows 10 Development

OS Settings Roaming in Windows 10

OS settings (personalization accessibility language SpartanIE support credentials vault etc) roam with the primary account

OS settings roam to OneDrive for Business for AAD identity

OS settings roam to OneDrive for MSA identity

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 86: Deeper into Windows 10 Development

App Settings Roaming in Windows 10

Whether the primary account is AAD or MSA user can acquire apps from both the consumer and (if available) the corporate store

App settings roam to OneDrive for Business for apps acquired from the corporate store

App settings roam to OneDrive for apps acquired from the consumer store

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 87: Deeper into Windows 10 Development

Roaming Data

UWP app ndash PFN 12345

Roaming

Local Temp

UWP app ndash PFN 12345

Roaming

LocalTemp

PFN 12345

Roamingfolder

App writes data using standard filesettings APIs

Sync engine transfers data periodically based on triggers (user idle battery network etc)

OneDrive (MSA identity) stores up to 100kb of roaming data per app (not included in user quota) If app exceeds the limit sync stops

Other clients are notified of updated data via Windows Notification Service If app is running when sync occurs an event is raised

Roamingsettings

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 88: Deeper into Windows 10 Development

Create shared mobile experiences whatever the device

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 89: Deeper into Windows 10 Development

Navigation with FrameNavigateSend to a type

Pass a string

Navigation servicePart of Template 10 project template

private void Goto2(object sender WindowsUIXamlRoutedEventArgs e) var app = AppCurrent as CommonBootStrapper var nav = appNavigationService navNavigate(typeof(ViewsPage2) My parameter value)

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 90: Deeper into Windows 10 Development

Navigation parametersPageOnNavigatedTo()Standard in Windows

ViewModelOnNavigatedToWith Template 10 project template

public override void OnNavigatedTo(string parameter NavigationMode mode IDictionaryltstring objectgt state) thisParameter = parameterToString() Empty

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 91: Deeper into Windows 10 Development

Back buttonEssentially same as Phone 81Back navigates back within app then to previous appUAP apps request the optional shell-drawn back button

With one improvementBacking out does not close the app

And a new scenario for tabletIn split screen there is a [back stack] for each side of the screen

WindowsUIViewManagementApplicationViewGetForCurrentView()IsShellChromeBackEnabled =

true

WindowsUICoreSystemNavigationManagerGetForCurrentView()BackRequested += HandleBack

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 92: Deeper into Windows 10 Development

Back supportSupport gesturesWindows + backspaceHardware back buttonKeyboard back buttonMouse back button(Template 10)

Opt-in to back in Windowed modeAutomatic in immersive

Some guidanceDonrsquot strand usersDonrsquot hijack back

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 93: Deeper into Windows 10 Development

Navigation is easier to develop across device families

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 94: Deeper into Windows 10 Development

Options for NetworkCloud ServicesBetter to use high-level frameworks and services where availableUse Microsoft Azure App Services to build a cloud backend services but use WebRoles WorkerRoles Queues etc if you need more flexibilityUse Microsoft Azure Notification Hubs to send notifications from backend services in preference to writing low-level networking code to achieve thisUse BackgroundTransfer to downloadupload filesUse Web Account Manager to perform OAuth2 authentication against Internet identity providersUse HttpClient for low level HTTP networking

>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 95: Deeper into Windows 10 Development
>

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 96: Deeper into Windows 10 Development

1 Need a token

2 App needs a token

3 Stored

6 Authenticate

7 Token

8 Token

9 Token

10 Gets data using the token

Web Account Manager

App

IdentityService Provider

Web Account Provider

UX

5 Creds4 Throw UI

Web Account Manager

Microsoft Web Account ProviderContoso Web Account Provider

Web Account Provider

YOUR

Browser

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 97: Deeper into Windows 10 Development

Auth Filter

503 Retry Filter

Metered Network Filter

REST Web Service

HttpClient

GetAsyncGetBufferAsyncGetInputStreamAsyncGetStringAsync

PostAsync

PutAsync

SendRequestAsync

The filter pipeline Your app

HttpRequestMessage

HttpResponseMessage

Http Base Protocol Filter

Has in-depth settings

HttpContentString bull Stream bull Buffer

bull Multipart bull FormUrlEncoded

Your code This is also a filter

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 98: Deeper into Windows 10 Development

Use existing networkcloud services to extend your application with little effort

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 99: Deeper into Windows 10 Development

Basic State

Plate

App Logo

Short Name

Plate

App Logo

Short Name

Semi-Live State

Plate

App Logo

Short Name

Badge

Plate

App Logo

Short Name

Badge

Live State

Plate

App Icon

Short Name

Badge

Content

Plate

Short Name

Badge

App Icon

Content

Tile anatomy

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 100: Deeper into Windows 10 Development

ToastsGlance (consume)See new information from your apps

Act (chase or take actions)Toasts invite you to begin or complete a task The toast is the apprsquos door by chasing (clicking) it Additional actions enable users to perform simple tasks without context switching

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 101: Deeper into Windows 10 Development

Toast states

Collapsed stateAction center chevron Mobile default

Expanded stateAction center chevron Desktop default

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 102: Deeper into Windows 10 Development

Interactive toastDesktop

Mobile

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 103: Deeper into Windows 10 Development

Tiles and toast notifications keep your users engaged

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 104: Deeper into Windows 10 Development

Windows 8081 Store Apps

Windows 80

Minimal code update required

Responsive UX DesignImplementation

Windows 10

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 105: Deeper into Windows 10 Development

Windows Phone 81 Store Apps (WinRT)

Windows Phone 81

Minor code updates for UAP APIs

Design UX for multiple form factors

Windows 10

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 106: Deeper into Windows 10 Development

Windows 81 Universal Apps

Windows 81

Merge UX

Refactor to single code-base amp to target UAP APIs

Windows 10

Windows Phone 81

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 107: Deeper into Windows 10 Development

Windows Phone Silverlight Apps

Silverlight on Windows Phone 81 can be a mix of Silverlight and WinRT APIs

Windows Phone 7578

Windows Phone 80

Windows Phone 81

Port the UI Silverlight -gt Windows XAML

Rewrite code to target UAP APIs

Design UX for multiple form factors

Windows 10

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 108: Deeper into Windows 10 Development

Win8 apps will run on Win10 but porting to UWP puts your app on more device families

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 109: Deeper into Windows 10 Development

LauncherLaunchUriAsync(new Uri(sampleappID=aea6))

LauncherLaunchFileAsync(file)

App to App Communication

URIProtocol Activation

Data in UriFile

UserOS chooses target

More on this in module 302 App to App Communication

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 110: Deeper into Windows 10 Development

Share Contract

DataTransferManagerShowShareUI()

Share DataPackage

User chooses target

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 111: Deeper into Windows 10 Development

Drag and DropExtended for ldquoWindowedrdquo Apps lt-- XAML --gtltGrid AllowDrop=True DragOver=Do_DragOver Drop=Do_Drop hellipgthellipltGridgt

My AppFile Explorer

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 112: Deeper into Windows 10 Development

Desktop Share UX Changes In W10Windows 8x Windows 8x app running on

Windows 10

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 113: Deeper into Windows 10 Development

Many apps will be a share sourceOnly a few will be a share target

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 114: Deeper into Windows 10 Development

Next Steps

bull Start Here bull https

devwindowscomen-usdownloadswindows-10-developer-tools

bull Get Windows 10 httpmicrosoftcomwindows

bull Get Visual Studio 2015 httpakamsvs2015ce

bull MVA video series bull httpakamsmva-win10-dev

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 115: Deeper into Windows 10 Development

GitHub

bull UWP Samplesbull https

githubcomMicrosoftWindows-universal-samples

bull Template10 bull httpsgithubcomWindows-XAMLTemplate10

bull MVA Samples bull httpsgithubcomWindows-XAML201505-MVA

bull Project Upgrade Utility bull httpakamsuwp-projectupgradeutility

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 116: Deeper into Windows 10 Development

Build 2015

bull Introducing the Windows 10 App Modelbull httpschannel9msdncomEventsBuild20152-617

bull Whats New in XAML for Universal Windows Apps

bull httpschannel9msdncomEventsBuild20152-629

bull Game Developers Get the Most Out of Windows 10

bull httpschannel9msdncomEventsBuild20152-637

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact
Page 117: Deeper into Windows 10 Development

Contact

Email shchowdmicrosoftcom Twitter shahedC

  • Deeper Into Windows 10 Development
  • Slide 2
  • Windows Core
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Apps dont target Windows 10 apps target the platform
  • Windows store packaging
  • Windows store distribution
  • Considerations
  • In-app purchases
  • The Windows store provides many ways to monetize your app
  • The XAML UI platform
  • Blend the XAML developerrsquos IDE
  • App bars and commands
  • Slide 17
  • The XAML UI platform is foundational to Windows
  • xBind
  • Syntax
  • Data Templates
  • When to use classic binding
  • xBind can meet your binding needs most of the time
  • Benefits on the universal platform
  • xPhase amp progressive rendering
  • Understanding deferral
  • xDefer example
  • The fastest code is the code you dont run
  • Adaptive controls
  • Input intelligence
  • Scaling algorithm
  • As you design
  • Adapt to different devices without targeting each and every dev
  • Visual States
  • How to set the visual state
  • Adaptive triggers
  • Custom adaptive triggers
  • Developers have many tools to build an adaptive UI
  • What are Adaptive Apps
  • Windows 81 Universal Shared code two binaries
  • Declare Device Family Dependencies
  • Extension SDKs
  • The device families you choose determines which APIs you can c
  • Locations where apps can access data
  • Package and App Data Folders
  • Directly Accessible RW Data Storage
  • KnownFolders
  • Provide multiple options for the user to loadsave data
  • Why SQLite
  • Choice of NET APIs
  • Installing the SQLite Library
  • Installing SQLitePCL to your Solution
  • Frameworks that use SQLite
  • SQLite provides a convenient option for your app
  • Enhanced App to App in Windows 10
  • URI Activation++
  • URI Activation++ (2)
  • Query URI Support
  • App Services Covered in separate module
  • Apps on Windows 10 can communicate in new ways
  • String resources
  • Resource loader
  • Multilingual app toolkit
  • Slide 64
  • Localizing your app will help you succeed in more regions amp loc
  • App Lifecycle
  • Handling suspension
  • Extended execution
  • Requesting extension in suspend
  • Understanding the App Life Cycle facilitates a smoother experie
  • Building a background task
  • Request Background Permission
  • System condition(s) [ if ]
  • Host tasks in foreground process
  • Background tasks can extend capabilities of your app
  • App Services
  • Scenario Bar Code Scanning
  • Scenario Enterprise suite of apps
  • Can I restrict access to my App Service
  • App services provides another way for applications to communica
  • Slide 81
  • Slide 82
  • User-Agent Strings
  • Slide 84
  • Slide 85
  • Slide 86
  • Edge enables a better webapp experience
  • Mobile Experiences - not just mobile devices
  • OS Settings Roaming in Windows 10
  • App Settings Roaming in Windows 10
  • Roaming Data
  • Create shared mobile experiences whatever the device
  • Navigation with FrameNavigate
  • Navigation parameters
  • Back button
  • Back support
  • Navigation is easier to develop across device families
  • Options for NetworkCloud Services
  • Slide 99
  • Web Account Manager
  • The filter pipeline
  • Use existing networkcloud services to extend your application
  • Tile anatomy
  • Toasts
  • Toast states
  • Interactive toast
  • Tiles and toast notifications keep your users engaged
  • Windows 8081 Store Apps
  • Windows Phone 81 Store Apps (WinRT)
  • Windows 81 Universal Apps
  • Windows Phone Silverlight Apps
  • Win8 apps will run on Win10 but porting to UWP puts your app o
  • App to App Communication
  • Share Contract
  • Drag and Drop Extended for ldquoWindowedrdquo Apps
  • Desktop Share UX Changes In W10
  • Many apps will be a share source Only a few will be a share tar
  • Next Steps
  • GitHub
  • Build 2015
  • Contact