Download presentation
Presentation is loading. Please wait.
1
Building Windows Phone Applications with Silverlight Your Name
2
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
3
What is Silverlight? Powerful Development Platform Engaging, Interactive User Experiences
4
Silverlight Capabilities Inputs Keyboard Mouse Touch Ink Media Digital media capture & playback VC1, WMA, MP3 Data Language Integrated Query (LINQ) LINQ to XML XML IsolatedStorage Base Class Library (BCL) Generics Collections Cryptography Threading Windows Communication Foundation REST RSS/ATOM SOAP XAML UI Core Vector Animation Text Images
5
Performance tuning Input integration H/W media and sensor integration OS application model integration Relaxed sandbox constraints What is Silverlight for WP7? Starts with Silverlight 3 plus…
6
AppModel
7
Pictures Take a look at recent photos People Look up the status for a contact Pictures Continue looking at recent photos UI Navigation: Example
8
Navigation PhoneApplicationFrame PhoneApplicationPage
9
PhoneApplicationPage More than the container for units of navigation OnChooserReturn OnOrientationChanged OnNavigatedFrom OnNavigatedTo OnBackKeyPress
10
Back key Lets the user to return to previously- viewed screens Can go back across applications Not used for application-specific behaviour
11
Application events Obscuring Activation
12
a world of constant interruptions phone calls App switch txt msgs :-) reminders low battery lock screen
13
Not running StartRunningExit basic application lifetime Obscured Paused
14
obscured: popup ui from shell RunningObscuredRunningUnobscured Games could auto- pause Game could auto-resume Phone call Reminder Battery low Not in the Mix build
15
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
16
Demo Pause and Exit
17
Panorama
19
Pivot
20
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
21
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
22
Silverlight to Script function runScriptStuff(arg1, arg2) { return “awesome”; } string out = wb.InvokeScript("runScriptStuff", arg1, arg2); Silverlight javascript
23
Script to Silverlight window.external.Notify(string); void wb_ScriptNotify(object s, NotifyEventArgs e) { string return = e.Value; } Silverlight javascript
24
Demo Web Browser Control
25
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
26
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
27
Launchers & Choosers Launchers CameraCaptureTask MarketplaceLauncher MediaPlayerLauncher PhoneCallTask SaveEmailAddressTask SavePhoneNumberTask SearchTask EmailComposeTask SMSComposeTask WebBrowserTask Choosers PhoneNumberChooserTask PhotoChooserTask EmailAddressChooserTask
28
Demo Launchers
29
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
30
Integrating with Windows Phone Hardware
31
Agenda Keyboard Touch Silverlight XNA Accelerometer Audio Video Location Compass
32
Keyboard
33
Demo Software Keyboard and Input Scope
34
Touch (in Silverlight)
35
Demo Touch in SIlverlight
36
Touch in XNA TouchPanel public static TouchPanelCapabilities GetCapabilities(); public static TouchCollection GetState(); TouchLocation public Vector2 Position { get; } public int Id { get; } public bool TryGetPreviousLocation (out TouchLocation … );
37
Accelerometer Measures force applied on each axis over time +Y -Y +X -X +Z -Z
38
Accelerometer AccelerometerSensor ReadingChanged even Start () Stop () AccelerometerReading X - Y – Z
39
Demo Accelerometer
40
Audio Input Mic input Gives access to raw PCM WAV data Calls BufferReady event at regular intervals Call the GetData method from the BufferReady event or as often as your app requires 10ms latency
41
Media Media support H/W decode MediaStreamSource PlayReady DRM MediaElement Limitations One MediaElement only No VideoBrush XNA sound effect API Supports polyphonic, looping wav data
42
Vibration Vibrates the phone for a given duration Useful for haptic feedback Notifying users of updates VibrateController vc = VibrateController.Default; vc.Start(TimeSpan.FromSeconds(2)); // vc.Stop (); //to stop it before the timespan
43
location Location services + Accuracy - Power - Speed - Indoors - Accuracy + Power + Speed - Wilderness +/- Accuracy +/- Power +/- Speed +/- Urban areas GPS
44
Location Services Smart device + cloud service Balance accuracy with time & power Consistent API across platforms
45
Demo location services
47
Thanks!! Q&A
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.