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
Silverlight for Windows Phone
AppModel
Pictures Take a look at recent photos People Look up the status for a contact Pictures Continue looking at recent photos UI Navigation: Example
Navigation PhoneApplicationFrame PhoneApplicationPage
PhoneApplicationPage More than the container for units of navigation OnChooserReturn OnOrientationChanged OnNavigatedFrom OnNavigatedTo OnBackKeyPress
Back key Lets the user to return to previously- viewed screens Can go back across applications Not used for application-specific behaviour
Demo Application Navigation
Application events Obscuring Activation
a world of constant interruptions phone calls App switch txt msgs :-) reminders low battery lock screen
Not running StartRunningExit basic application lifetime Obscured Paused
obscured: popup ui from shell RunningObscuredRunningUnobscured Games could auto- pause Game could auto-resume Phone call Reminder Battery low Not in the Mix build
paused: jump to another app RunningPauseSuspendedResume 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
Demo Pause and Exit
Windows Phone Controls
Panorama
Pivot
ApplicationBar & SystemTray SystemTray No integration, but does affect Layout Show:Hide using SystemTray.IsVisible ApplicationBar Buttons (up to 4) Menu Items ( recommend 6) Toggle: .ApplicationBar.IsVisible
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
Silverlight to Script function runScriptStuff(arg1, arg2) { return “awesome”; } string out = wb.InvokeScript("runScriptStuff", arg1, arg2); Silverlight javascript
Script to Silverlight window.external.Notify(string); void wb_ScriptNotify(object s, NotifyEventArgs e) { string return = e.Value; } Silverlight javascript
Demo Web Browser Control
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
OS and hub integration
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, , 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
Launchers & Choosers Launchers CameraCaptureTask MarketplaceLauncher MediaPlayerLauncher PhoneCallTask Save AddressTask SavePhoneNumberTask SearchTask ComposeTask SMSComposeTask WebBrowserTask Choosers PhoneNumberChooserTask PhotoChooserTask AddressChooserTask
Demo Launchers
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
Thanks!! Questions?