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.
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. 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. 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. 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
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. 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. 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;
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
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. 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. LESSONS LEARNED – WINDOWS STORE
• Privacy Policy
– Must have privacy policy if accessing any external
resources and storing any data.
http://www.privacychoice.org
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. LESSONS LEARNED – WINDOWS STORE
• How to create all of the
required image sizes?
– PerfecTile for Windows 8
– http://nirm.it/PerfecTile/
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. WHAT’S NEXT?
• Windows 8.1 Version
• New Features
• Cross Platform with Xamarin (IOS, Android, WP8)
• Web version
• Writing TFS book
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. 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