5. Application Framework details Windows Phone Frameworks Camera Device Integration Launchers & Choosers Windows Phone Controls PhoneApplicationPage PushNotification WebBrowserControl Sensors PhoneApplicationFrame Silverlight Presentation and Media XNA Frameworks for Games Controls Drawing IsolatedStorage Drawing GamerServices Navigation Shapes Markup Media Audio Media Graphics Content Input Application Object Common Base Class Library Diagnostics Reflection IO Runtime Resources Globalization Text Location Net Collections ComponentModel Configuration Security Threading ServiceModel Linq
25. Whatmakes Silverlight so Special? M X A L eXtensible Application Markup Language XML Declarative Markup <Grid> <TextBlockFontSize="48" Text="Hello world" /> </Grid>
26. Whatmakes Silverlight so Special? Code XAML XAML maps to code Anything in XAML can be done in code
27. SilverligthAppModel - What’s a XAP? myapp.xap Tools Common format for all Windows Phone apps & games Declarative, manifest-based installation Integrated into security model of phone
32. Media Media support H/W decode MediaStreamSource PlayReady DRM XNA framework sound effect API Supportspolyphony and looping MediaElement Only supports one MediaElement for page VideoBrush is not supported
33. XNA for Windows Phone 7 Using XNA audio capabilitiesisneeded UsingnamespaceMicrosoft.Xna.Framework.Audio TogetherwithSoundEffect and SoundEffectInstance AddingtheWavsoundfile as a contentelementtotheproject. // Audio SoundEffectsoundEffect; string soundName = "kaboom"; // Loading and playing audio soundEffect = contentManager.Load<SoundEffect>(soundName); soundEffect.Play();
34. Vibration Makesthephonevibrateduring a specificduration Useful for giving a tactile response totheuser. Tonotifyusers of anupdate. VibrateControllervc = VibrateController.Default; vc.Start(TimeSpan.FromSeconds(3)); Microsoft.Devices.Sensors
36. SIP I SIP Stands for Software Input Panel. TheTextBox Silverlight control integrateswith SIP SIP supportsaround 60 differentInputScopes:
37. SIP II SIP can bepersonalizedwithseveralversions of thekeyboardthattheuser can selectbetween. Buttheapplication can also show theoptimumkeyboard. We use InputScopeto do that, for example: <TextBoxGrid.Row="1" Name="tbNombre" Text=""> <TextBox.InputScope> <InputScope> <InputScopeNameNameValue="PersonalGivenName"></InputScopeName> </InputScope> </TextBox.InputScope> </TextBox>
43. ApplicationBar & ContextMenu The «Application Bar» is a control systemthatprovides a quickaddition of a tool bar for our WP7 application. ApartfromtheApplication Bar, applications can provideadditionaloptionslikeshowingoneor more menuelements. Microsoft.Phone.Shell
44. ApplicationBar & ContextMenu By default wehave a sample XAML Code for quicklyenablingthisfeaturesonourapplications: <phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBarIsVisible="True" IsMenuEnabled="True"> <shell:ApplicationBarIconButtonIconUri=“/appbar_button1.png" Text="Button 1"/> <shell:ApplicationBarIconButtonIconUri=“/appbar_button2.png" Text="Button 2"/> <shell:ApplicationBar.MenuItems> <shell:ApplicationBarMenuItemText="MenuItem 1"/> <shell:ApplicationBarMenuItemText="MenuItem 2"/> </shell:ApplicationBar.MenuItems> </shell:ApplicationBar> </phone:PhoneApplicationPage.ApplicationBar>
45. Navigation: Frame and Page Frame Isthetopmostcontainer control. PhoneApplicationFrameclass. Containsthe page control and sytsemelements, likeSystemTray, app bar, etc.. Page Fillstheentirecontentregion of theFrame. Derives fromtheclassPhoneApplicationPage. Contains a title. Can haveitsownapplication bar.
46. Orientation In VS2010 we can add a Landscape Page or a Portrait Page. TheonlydifferenceisonthepropertySupportedOrientationwhich can be: Portrait Landscape PortraitOrLandscape Wecan’tchangethe page orientation in code. Butwe can reacttoitschangesthroughtheOrientationChangedevent.