Lessons Learned from Building Windows 8 Store
Apps with MVVM and XAML
Mike Douglas
mikedouglas@Deliveron.com
@mikedouglasd...
AGENDA
• Background
• Why XAML/C#/MVVM?
• Lessons Learned
• What’s Next?
ABOUT MIKE DOUGLAS
• Solution Consultant for Deliveron
Consulting Services
• Microsoft Visual Studio ALM MVP
• Microsoft E...
ABOUT DELIVERON
• Project based, technology
consulting
• Areas of Expertise:
– SharePoint
– BizTalk
– Business Intelligenc...
BACKGROUND
• The Challenge
• TFS Agile Poker (www.tfsagilepoker.com)
– MVVM, XAML, WinRT, Async/Await, OData/RES
T, Azure ...
WHY XAML/C#/MVVM?
• XAML/C# vs HTML5/JavaScript
– Matching feature sets
– Originally thought I was going to use HTML5/Java...
LESSONS LEARNED
• Design
• Development
• Testing
• Deployment to the Windows Store
LESSONS LEARNED - DESIGN
LESSONS LEARNED - DESIGN
• Storyboarding
– Create wireframe and visualize design
• Frameworks
– Roll your own
– Utilize Ex...
LESSONS LEARNED - DEVELOPMENT
• Async / Await
– No UI blocking threads
Method Signature Example Usage
Async Void private a...
LESSONS LEARNED - DEVELOPMENT
• Persisting Data
– Scenarios
• Session State
• Local or Roaming Settings
– Default Serializ...
LESSONS LEARNED - DEVELOPMENT
• Styling and Data Templates
LESSONS LEARNED - DEVELOPMENT
• DataBinding
– Properties support 2 way binding
– Converters
• Boolean To Visibility
LESSONS LEARNED - DEVELOPMENT
• Commanding
LESSONS LEARNED - DEVELOPMENT
• Behaviors
– Only buttons have a Command property
– Attached Properties extend object with ...
LESSONS LEARNED - DEVELOPMENT
• Simulating Suspending and Terminating from VS
LESSONS LEARNED - DEVELOPMENT
• Team Agile Poker Demo
LESSONS LEARNED - TESTING
LESSONS LEARNED - TESTING
• Dependency Injection / IOC
– Recently released frameworks for PCL
• Unity
• Ninject
• Coded UI...
LESSONS LEARNED – WINDOWS STORE
LESSONS LEARNED – WINDOWS STORE
• Windows App Certification Kit
LESSONS LEARNED – WINDOWS STORE
• Gracefully handle common scenarios
– Unhandled Exceptions -> NO CRASHES!
– Midstream Net...
LESSONS LEARNED – WINDOWS STORE
• Don’t make your company name / app name too long
– Error Found: The performance launch t...
LESSONS LEARNED – WINDOWS STORE
• Privacy Policy
– Must have privacy policy if accessing any external
resources and storin...
LESSONS LEARNED – WINDOWS STORE
• When submitting
– Tester Notes
• Assume it is one of your grandparents is doing the
revi...
LESSONS LEARNED – WINDOWS STORE
• How to create all of the
required image sizes?
– PerfecTile for Windows 8
– http://nirm....
LESSONS LEARNED – WINDOWS STORE
• App Certification Demo
LESSONS LEARNED – WINDOWS STORE
LESSONS LEARNED – WINDOWS 8.1
LESSONS LEARNED – WINDOWS 8.1
• Windows 8.1
– Currently in preview, released as free update in Windows
Store on 10/17
– No...
WHAT’S NEXT?
• Windows 8.1 Version
• New Features
• Cross Platform with Xamarin (IOS, Android, WP8)
• Web version
• Writin...
RESOURCES
• Xamarin and MvvmCross
– http://xamarin.com/evolve/2013#session-dnoeeoarfj
• Prism for Windows 8
– http://prism...
1 1 5 1 6 M i r a c l e H i l l s D r i v e S u i t e 2 0 1 O m a h a , N E 6 8 1 5 4
4 0 2 . 2 3 8 . 1 3 9 9 | w w w . d ...
Upcoming SlideShare
Loading in …5
×

Lessons Learned from Building Windows 8 Store Apps with MVVM and XAML

3,975 views

Published on

In this presentation I go through the lessons learned from building Windows 8 Store apps. I will walk through some Windows 8 basics, go into the MVVM framework and why I chose MVVM/XAML/C#. Next I will talk about page state and persisting data. Then I will show how to use data templates and styling with MVVM and XAML. Last I'll also talk about publishing my application to the App Store.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Lessons Learned from Building Windows 8 Store Apps with MVVM and XAML

  1. 1. Lessons Learned from Building Windows 8 Store Apps with MVVM and XAML Mike Douglas mikedouglas@Deliveron.com @mikedouglasdev
  2. 2. AGENDA • Background • Why XAML/C#/MVVM? • Lessons Learned • What’s Next?
  3. 3. ABOUT MIKE DOUGLAS • Solution Consultant for Deliveron Consulting Services • Microsoft Visual Studio ALM MVP • Microsoft External Rangers – Visual Studio ALM • HDC, KCDC, OTSUG Presentations • Team Deploy – TeamDeploy.CodePlex.com • Blog - CodeSmartNotHard.com • Email – mikedouglas **at** deliveron.com • Twitter - @mikedouglasdev
  4. 4. ABOUT DELIVERON • Project based, technology consulting • Areas of Expertise: – SharePoint – BizTalk – Business Intelligence – .NET Development – ALM Training and Consulting • Deliveron Jumpstarts • Newsletters & Webcasts • www.Deliveron.com
  5. 5. BACKGROUND • The Challenge • TFS Agile Poker (www.tfsagilepoker.com) – MVVM, XAML, WinRT, Async/Await, OData/RES T, Azure Mobile Services. • ALM Readiness TreasureMap – Open source app for managing ALM Ranger’s guidance and tools – http://tinyurl.com/almtreasuremap
  6. 6. WHY XAML/C#/MVVM? • XAML/C# vs HTML5/JavaScript – Matching feature sets – Originally thought I was going to use HTML5/JavaScript – XAML/C# - Databinding and new features – XAML is only way to get cross platform between • Win8 • WP • MVVM Cross and Xamarin – IOS – Android
  7. 7. LESSONS LEARNED • Design • Development • Testing • Deployment to the Windows Store
  8. 8. LESSONS LEARNED - DESIGN
  9. 9. LESSONS LEARNED - DESIGN • Storyboarding – Create wireframe and visualize design • Frameworks – Roll your own – Utilize Existing • IOC support • Flyout support • View to ViewModel auto wiring • Examples – MvvmLight – Prism
  10. 10. LESSONS LEARNED - DEVELOPMENT • Async / Await – No UI blocking threads Method Signature Example Usage Async Void private async void OnSubmitPointsCommand() Asynchronous Event Handlers only Potentially await-able Async Task public async Task CloseSessionAsync(string session) Use when returning void Async Task<T> public async Task<Session> CreateSessionAsync() Use when having a return value Await SomeMethodAsync CurrentChannel = await PushNotificationChannelManager.CreatePushNot ificationChannelForApplicationAsync(); Used to create asynchronous method and doesn’t block UI thread
  11. 11. LESSONS LEARNED - DEVELOPMENT • Persisting Data – Scenarios • Session State • Local or Roaming Settings – Default Serialization • Painful, requires KnownTypes definitions, DataMember attributes – JSON string serializedSettings = Newtonsoft.Json.JsonConvert.SerializeObject(appSettings); applicationSettings = Newtonsoft.Json.JsonConvert.DeserializeObject<ApplicationSetting>(serializedSe ttings); – Roaming Settings Windows.Storage.ApplicationData.Current.RoamingSettings.Values["ApplicationS ettings"] = serializedSettings;
  12. 12. LESSONS LEARNED - DEVELOPMENT • Styling and Data Templates
  13. 13. LESSONS LEARNED - DEVELOPMENT • DataBinding – Properties support 2 way binding – Converters • Boolean To Visibility
  14. 14. LESSONS LEARNED - DEVELOPMENT • Commanding
  15. 15. LESSONS LEARNED - DEVELOPMENT • Behaviors – Only buttons have a Command property – Attached Properties extend object with Command
  16. 16. LESSONS LEARNED - DEVELOPMENT • Simulating Suspending and Terminating from VS
  17. 17. LESSONS LEARNED - DEVELOPMENT • Team Agile Poker Demo
  18. 18. LESSONS LEARNED - TESTING
  19. 19. LESSONS LEARNED - TESTING • Dependency Injection / IOC – Recently released frameworks for PCL • Unity • Ninject • Coded UI Testing support in Windows 8.1 / VS 2013 – Extensive gesture support • Microsoft Test Manager – Execute test cases against device – Log and capture error information for bugs
  20. 20. LESSONS LEARNED – WINDOWS STORE
  21. 21. LESSONS LEARNED – WINDOWS STORE • Windows App Certification Kit
  22. 22. LESSONS LEARNED – WINDOWS STORE • Gracefully handle common scenarios – Unhandled Exceptions -> NO CRASHES! – Midstream Network Loss and no network connectivity – Snapped Views – Adaptive to support multiple resolutions (1366 x 768, 1920 x 1080)
  23. 23. LESSONS LEARNED – WINDOWS STORE • Don’t make your company name / app name too long – Error Found: The performance launch test collected the following results:. • The Native Image Generator failed due to long file path for file C:Program FilesWindowsAppsDeliveronConsultingServic.TeamPlanningPok er_1.0.0.1_neutral__s9dp6hmz44fsaMicrosoft.Data.Services.Clie nt.WindowsStore.dll • The Native Image Generator failed due to long file path for file C:Program FilesWindowsAppsDeliveronConsultingServic.TeamPlanningPok er_1.0.0.1_neutral__s9dp6hmz44fsaMicrosoft.WindowsAzure.Mo bileServices.Managed.dll – To Skip NGEN • Add nongen.txt file to root folder of project.
  24. 24. LESSONS LEARNED – WINDOWS STORE • Privacy Policy – Must have privacy policy if accessing any external resources and storing any data. http://www.privacychoice.org
  25. 25. LESSONS LEARNED – WINDOWS STORE • When submitting – Tester Notes • Assume it is one of your grandparents is doing the review. • Assume no domain knowledge – Some markets have restrictions • Had to change rating to 12+ (email) • Some countries require an official game rating
  26. 26. LESSONS LEARNED – WINDOWS STORE • How to create all of the required image sizes? – PerfecTile for Windows 8 – http://nirm.it/PerfecTile/
  27. 27. LESSONS LEARNED – WINDOWS STORE • App Certification Demo
  28. 28. LESSONS LEARNED – WINDOWS STORE
  29. 29. LESSONS LEARNED – WINDOWS 8.1
  30. 30. LESSONS LEARNED – WINDOWS 8.1 • Windows 8.1 – Currently in preview, released as free update in Windows Store on 10/17 – No more snapped views, can adjust to any size – Windows 8.0 apps will work on Windows 8.1 – Windows 8.1 apps will not work on Windows 8.0
  31. 31. WHAT’S NEXT? • Windows 8.1 Version • New Features • Cross Platform with Xamarin (IOS, Android, WP8) • Web version • Writing TFS book
  32. 32. RESOURCES • Xamarin and MvvmCross – http://xamarin.com/evolve/2013#session-dnoeeoarfj • Prism for Windows 8 – http://prismwindowsruntime.codeplex.com/ • PerfecTile – http://nirm.it/PerfecTile/ • CUIT Gestures in VS 2013 – http://blogs.msdn.com/b/visualstudioalm/archive/2013/08/17/coded-ui-test-gesture- support-in-visual-studio-2013.aspx • The Tablet Show – Getting apps into the Store – http://thetabletshow.com/?ShowNum=70 • Pluralsight Courses – http://www.pluralsight.com/training/Courses/TableOfContents/windows8-hands-on – http://www.pluralsight.com/training/Courses/TableOfContents/win8mvvm • Free Online Privacy Policy tool – http://www.privacychoice.org
  33. 33. 1 1 5 1 6 M i r a c l e H i l l s D r i v e S u i t e 2 0 1 O m a h a , N E 6 8 1 5 4 4 0 2 . 2 3 8 . 1 3 9 9 | w w w . d e l i v e r o n . c o m | c o n t a c t u s @ d e l i v e r o n . c o m

×