Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Sharing code win8 wp8

884 views

Published on

  • Be the first to comment

  • Be the first to like this

Sharing code win8 wp8

  1. 1. Sharing code withWindows 8 andWindows Phone 8Matt HidingerClarity Consulting
  2. 2. Clarity <3 Windows Phone
  3. 3. AgendaDeveloper ChoiceSharing StrategiesDemos (code)UX considerations
  4. 4. Windows Phone 8 Developer Platform XAML Apps Direct3D Apps In-App XAML Maps Geolocation Sensors Direct3D Purchase HTML XML Threading Touch Speech XAudio2Your apps Phone Features Push Camera Video Proximity Media FoundationYour way Calendar Wallet Contacts Core Types VoIP STL Multitasking Live Tiles Memory Async Enterprise CRT C# and VB C#, VB, and C++ C++ File system, Networking, Graphics, Media Core Operating System
  5. 5. shared core Full WinRT 11,000 members Windows Phone Runtime 2,800 shared members 600 new members
  6. 6. Sharing techniques
  7. 7. Common Structure Windows 8 Windows Phone 8
  8. 8. Model-View-ViewModelWindows 8 Windows Phone 8public class Product public class Product{ { public int Id { get; set; } public int Id { get; set; } [DataMember(Name = "text")] [DataMember(Name = "text")] public string Text { get; set; } public string Text { get; set; } [DataMember(Name = "complete")] [DataMember(Name = "complete")] public bool Complete { get; set; } public bool Complete { get; set; }} }
  9. 9. Ctrl-CCtrl-V
  10. 10. “Add as Link”
  11. 11. “Add as Link”Windows 8 Windows Phone 811 Microsoft confidential 12/5/2012
  12. 12. Dispatcher DifferencesWindows 8Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>{ MyTextBlock.Text = "Hello from the UI thread!";});Windows Phone 8Deployment.Current.Dispatcher.BeginInvoke(() =>{ MyTextBlock.Text = "Hello from the UI thread!";}); 12/5/2012
  13. 13. #if Conditional BlocksWindows 8 #if NETFX_CORE Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { #endifWindows Phone 8 #if WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { #endif13 Microsoft confidential 12/5/2012
  14. 14. Portable Class Libraries One Source One Project One Binary Multiple Platforms!
  15. 15. Portable Class Library and MVVM
  16. 16. Your You know C# You know .NET You know and love XAML (right?)skills
  17. 17. Demo
  18. 18. UX Considerations
  19. 19. Web Service19 Microsoft confidential 12/5/2012
  20. 20. UI Differences and XAML20 Microsoft confidential 12/5/2012
  21. 21. Different Form Factors Require Different UXWindows Phone 8 Windows 8Screen Size Screen Size800x480 1024x7681280x720 2,560x1,4401280x768 everything in between
  22. 22. Different Form Factors Require Different UXWindows Phone 8 Windows 8Orientation OrientationPortrait PortraitLandscape Landscape Snapped
  23. 23. Different ControlsGridViewGroup-ableArray of TilesDynamic item size
  24. 24. Different Form Factors Require Different UX Panorama Introduction and exploratory content25 Microsoft confidential
  25. 25. Different Form Factors Require Different UX LongListSelector Headers and Footers Group header navigation26 Microsoft confidential
  26. 26. Different Form Factors Require Different UXGridView  LongListSelector29 Microsoft confidential
  27. 27. Way cross platform
  28. 28. http://bit.ly/NXVdHX
  29. 29. Summary
  30. 30. Windows 8 / Windows Phone 8 Apps Are a Perfect Match• Mix and match techniques• Share Models, Helpers, Services, ViewModels • Linked files • Portable Class Libraries• Using #if conditionals for small code differences• Using Extension methods to bridge implementation differences • Async-await model for HttpWebResponse/Request• Focus on the user experience that works for the form factor33 Microsoft confidential 12/5/2012
  31. 31. Some WP7 LoveWP7 can do Async/Await! Install-Package Microsoft.Bcl.AsyncPCLs can add this package too!34 Microsoft confidential 12/5/2012
  32. 32. MVVM FrameworksCaliburn.MicroMVVM Light
  33. 33. Lessons LearnedShare code – architect with sharing in mindMaximize the user experience in the UIUse existing skills and knowledge
  34. 34. Thank you!@MattHidingerjobs@claritycon.com

×