building windows phone applications with silverlight jaime rodriguez

31
Building Windows Phone Applications with Silverlight Jaime Rodriguez http://blogs.msdn.com/jaimer @ jaimerodriguez

Upload: marion-ramsey

Post on 06-Jan-2018

220 views

Category:

Documents


1 download

DESCRIPTION

Silverlight for Windows Phone

TRANSCRIPT

Page 1: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Building Windows Phone Applications with Silverlight

Jaime Rodriguezhttp://blogs.msdn.com/jaimer @jaimerodriguez

Page 2: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Agenda

Introduction App model

Navigation Events

Phone Controls Panorama Pivot Web Browser Bing Maps Control DeepZoom Templates and Styles

OS and in-box App Integration

Page 3: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Silverlight for Windows Phone

3

Page 4: Building Windows Phone Applications with Silverlight Jaime Rodriguez

AppModel

Page 5: Building Windows Phone Applications with Silverlight Jaime Rodriguez

PicturesTake a look at recent photos

PeopleLook up the status

for a contact

PicturesContinue looking at recent photos

UI Navigation: Example

Page 6: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Navigation

PhoneApplicationFrame PhoneApplicationPage

Page 7: Building Windows Phone Applications with Silverlight Jaime Rodriguez

PhoneApplicationPage

More than the container for units of navigation OnChooserReturn OnOrientationChanged OnNavigatedFrom OnNavigatedTo OnBackKeyPress

Page 8: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Back key

Lets the user to return to previously-viewed screens

Can go back across applications

Not used for application-specific behaviour

Page 9: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Demo

Application Navigation

Page 10: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Application events

Obscuring Activation

Page 11: Building Windows Phone Applications with Silverlight Jaime Rodriguez

a world of constant interruptionsphone calls

App

switchtxt

msgs :-)

reminders

low

batterylock scree

n

Page 12: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Not runnin

g

Start

Running

Exit

basic application lifetime

• Obscured• Paused

Page 13: Building Windows Phone Applications with Silverlight Jaime Rodriguez

obscured: popup ui from shell

Running

Obscured

Running

Unobscured

Games could auto-pause

Game could auto-resume

• Phone call

• Reminder• Battery

low

Not in the Mix build

Page 14: Building Windows Phone Applications with Silverlight Jaime Rodriguez

paused: jump to another app

Running

Pause

Suspended

Resume

Assume your process is killed

Save state for later use

Load state to continue where you left off

Not in the Mix build

User never knows what happened :-)

• Start Button

• Accept call• Open toast

Page 15: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Demo

Pause and Exit

Page 16: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Windows Phone Controls

Page 17: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Panorama

Page 18: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Panorama

Page 19: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Pivot

Page 20: Building Windows Phone Applications with Silverlight Jaime Rodriguez

ApplicationBar & SystemTray

SystemTray No integration, but does affect

Layout Show:Hide using

SystemTray.IsVisible

ApplicationBar Buttons (up to 4) Menu Items ( recommend 6) Toggle: <mypage>.ApplicationBar.IsVisible

Page 21: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Web Browser Control

Displays network and local content Supports pan, double tap and pinch to zoom Supports transforms & projections

No Input on transform Application can interact with javascript Optimized for privacy

Script is disabled by default Cookies and cache are isolated

Page 22: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Silverlight to Script

function runScriptStuff(arg1, arg2){ return “awesome”; }

string out = wb.InvokeScript("runScriptStuff", arg1, arg2);

Silverlight

javascript

Page 23: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Script to Silverlight

window.external.Notify(string);

void wb_ScriptNotify(object s, NotifyEventArgs e){ string return = e.Value;}

Silverlight

javascript

Page 24: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Demo

Web Browser Control

Page 25: Building Windows Phone Applications with Silverlight Jaime Rodriguez

MultiScaleImage ( aka deepzoom)

Included in core run-time Optimized to take advantage of GPU Consumes same content as SL on desktop Supported for Online content

not isolated storage or embedded content No oob gesture support

Manipulation APIs make this easy though

Page 26: Building Windows Phone Applications with Silverlight Jaime Rodriguez

OS and hub integration

Page 27: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Integrating with the OS

Hub integration Enhance the built in hubs with your application

Launchers let you fire and forget to an OS app SMS, email, web browser, maps, dialer, search, etc

Choosers are like an open file dialog Launches an OS experience for letting the user choose

data for the app Picture, contact, camera, etc

Page 28: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Launchers & Choosers

Launchers CameraCaptureTask MarketplaceLauncher MediaPlayerLauncher PhoneCallTask SaveEmailAddressTask SavePhoneNumberTask SearchTask EmailComposeTask SMSComposeTask WebBrowserTask

Choosers PhoneNumberChooserTas

k PhotoChooserTask EmailAddressChooserTas

k

Page 29: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Demo

Launchers

Page 30: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Isolated Storage

Compatible APIs with Silverlight on desktop No quota limits Not shared (ever)

No write access to Media Library, use XNA for that

Use for your application settings

Page 31: Building Windows Phone Applications with Silverlight Jaime Rodriguez

Thanks!! Questions?