WP8 XAML App Development
description
Transcript of WP8 XAML App Development
WP8 XAML App DevelopmentShawn OsterSenior Program Manager2-021
OverviewBuilding WP8 appsWhat about WP7 appsQ&A
Agenda
Overview
A declarative, markup-based language to define your user experienceThe way to write apps for Windows PhoneAligns with Windows 8
eXtensible ApplicationMarkupLanguage
What is XAML?
Windows Phone 8 app modelsDirect3D App
C++XAML AppC# / VB
Windows Phone 8 API Set
Graphics Audio Media
File System Networking Input
Commerce Base Types Sensors
Common.NET FX
CoreCLR
Direct3DInterop
C++Reuse
Building WP8 apps
Project infrastructure and designTemplates, localization, multiple resolutionsBuilding BlocksPanorama, Pivot, LongListSelector, Map, WebBrowser, Pinch + Stretch, ViewportControl.NETasync/await, threading, event timing
What’s covered during this talk
New XAML app features
File | New
Project infrastructure and design
New and Updated Project TemplatesHTML5, Localization Support, Alignment Grid
Project templates
Use resource strings from the start, both code-behind and XAMLFlowDirection controls UI mirroringLeftToRight, RightToLeft (RTL)Full support for RTL, bi-directional textWP8 XAML text stack uses DWrite
Global reach
Localization
Multiple resolutionsWVGA (480 x 800) 720p (720 x 1280) – 1.5 scaledWXGA (768 x 1280) – 1.6 scaledLayout is in logical vs. physical pixelsAssets will be scaled so always use highest resolution
DecodePixelWidth/DecodePixelHeight to save memory
“You look marvelous!”
Multiple resolutions
WVGA480x8001.0 Scale
720p720x12801.5 Scale
WXGA768x12801.6 Scale
400 Logical400 Physical
400 Logical600 Physical
400 Logical640 Physical
30 Logical30 Physical
30 Logical45 Physical
30 Logical48 Physical
2 Logical2 Physical
2 Logical3 Physical
2 Logical3 Physical (Rounded)
Think about layouts in WVGA pixelsThink about graphics / videos in WXGA
New templates, improvements, design help, localization, multiple resolutions, decoding pixels
Walk-thru: Project infrastructure
Controls
Building blocks
ProgressBar animates off-threadPanorama, Pivot & LongListSelector all in ROMReduced Panorama memory usageImproved “first touch” experience for signature controls
Control Improvements
Drag picture to placeholder or click icon to add
LongListSelectorJumpList Sticky HeadersGrid View
Converting a ListBox, styles, locale-aware grouping, grid view
Demo: LongListSelector
Grouping requires an IList of IList Does UI virtualizationItemRealized is the key to infinite scrollingRemember to set IsGroupingEnabled
Always know where you are
LongListSelector
InteractivityOff-thread input, panning, fluid pinch+stretchOverlay layersUIElement position and scale transforms no longer updated on UI threadVector-basedRender from vector data, readable labels, perspective viewOffline mapsCommon cache across all applications
Always know where you are, thanks Nokia!
Maps
IE10-basedSupports HTML5 featuresLocal storage, CSS3Supports gestures
Mango apps run in IE9 compatibility mode
A more beautiful web, in your apps
WebBrowser
Extends the ManipulationDeltaEventArgs classPinchManipulation propertyProvides center point for the original and current gesture
Completing the gesture story
Pinch + Stretch
More “primitive” than ScrollViewerAble to update bounds dynamicallyDesigned specifically for touch-specific scenariosBase-control for LongListSelectorInput is off-thread
A new primitive for controls
ViewportControl
Renamed to “Windows Phone toolkit”Moved to http://phone.codeplex.com
Where are the “rest” of the controls?
Toolkit
DemoHandling pinch + stretch using the ViewportControl
Creating an image zoom control
Same CLR as Windows 8Compile in the Cloud Portable LibrariesNew APIsasync/await for easier asynchronous programming, CallerMemberName
More than just keywords (but there are some pretty great keywords too)
CoreCLR
Demoasync/await, CallerMemberName
Simplify your code
What about WP7 code?
Massive effort on making sure the top apps and API are compatibleTools can target both 7.1 and 8.0Binary vs. Source compatLight UpCode sharing
Migrating your app from WP7 to WP8
Application compatibility
WP8 at BUILDTuesday 10/30
11:45 – 12:45 | WP8 Application Model | 92 Nexus/Normandy02:15 – 03:15 | WP8 Native C/C++ Game Development | 92 Magellan04:00 – 0:500 | How to Leverage your code across WP8 and Windows 8
| 92 Nexus/Normandy04:00 – 0:500 | WP8 XAML Application Development | 92 Magellan05:45 – 06:45 | WP8 In App Purchase & Developer Center
| 92 Nexus/Normandy
WP8 at BUILDWednesday 10/3111:15 – 12:15 | WP8 Critical Dev Practices | 92 Magellan01:45 – 02:45 | WP8 Networking, Bluetooth, NFC | 92 Nexus/Normandy03:30 – 04:30 | WP8 Making Money with your Application | 92 Magellan05:15 – 06:15 | WP8 HTML5/IE10 for Developers | 92 Magellan
WP8 at BUILDThursday 11/108:30 - 09:30 | WP8 Maps, Location & Background | 92 Magellan10:15 – 11:15 | WP8 Performance & Optimization | 92 Magellan12:00 – 01:00 | WP8 Photo & Lens Apps | 92 Magellan02:30 – 03:30 | How to Leverage your code across WP8 and
Win 8 | 33 McKinley02:30 – 03:30 | WP8 Tiles, Lock and Notifications | 92 Magellan04:15 – 0:515 | WP8 Native C/C++ Game Development | 33 McKinley04:15 – 05:15 | WP8 Using C++ in your Applications | 92 Magellan
WP8 at BUILDFriday 11/2
08:30 – 09:30 | WP8 Using C++ in your Applications | 33 McKinley08:30 – 09:30 | WP8 Using the Speech API | 92 Magellan10:15 – 11:15 | WP8 Wallet and Deals | 92 Magellan12:45 – 01:45 | WP8 App to App Communication | 92 Magellan02:30 – 03:30 | WP8 Enterprise Development | 92 Magellan
Windows Phone Dev Centerhttp://dev.windowsphone.com/en-us
Windows Phone Toolkithttp://phone.codeplex.com
Bloghttp://shawnoster.com
Resources
QuestionsAnswers(Please do your eval!)
Thank You!
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.