SlideShare une entreprise Scribd logo
1  sur  48
Building a Modern Windows App 
Brent Edwards 
Principal Lead Consultant 
BrentE@magenic.com 
@brentledwards 
brentedwards.net 
https://github.com/brentedwards
November 17-21 
Royal Pacific Resort at Universal 
Orlando, FL 
More info: http://modernappslive.com 
Register and save money: http://bit.ly/LSPK27REG
What We Will Cover 
• MVVM 
• Universal Apps 
• Dealing with Code Differences 
• Navigation 
• Application Settings 
• Secondary Tiles 
• Contracts 
• Unit Testing
Charmed Framework
Charmed Framework 
• Open source, Windows-based MVVM support library 
– Windows 8.1 
– Windows Phone 8.1 
– Updated to Universal Apps 
• https://github.com/brentedwards/Charmed
Charmed Reader 
[Demo]
MVVM 
Model-View-ViewModel
Model-View-ViewModel
Why is MVVM Cool? 
• Separates Presentation from Functionality 
• Promotes Testability 
• Works great with Data Binding 
• Easy collaboration with Designers 
• Makes it easy to change out the View layer!
Universal Apps 
Sharing the love
Universal Apps 
• What are they? 
– One codebase to rule them all (on Windows, anyway) 
Source: https://dev.windows.com/en-us/develop/building-universal-Windows-apps
Universal Apps 
• Project type that came with Visual Studio 2013 Update 2
Universal Apps 
• Introduces concept of Universal Shared Project type 
– Essentially a code placeholder project 
• Does not compile on its own
Universal Shared Projects 
• Put common code in universal shared project 
– Platform-specific code in platform-specific projects 
• What is common? 
– Models 
– ViewModels 
– Converters 
– Services 
• What about views? 
– That depends…
Universal Shared Projects 
• A helpful Visual Studio extension 
– Shared Project Reference Manager 
• http://visualstudiogallery.msdn.microsoft.com/315c13a7-2787-4f57-bdf7-adae6ed54450
Dealing With Code Differences
Dealing With Code Differences 
• What is different? 
– Not a lot anymore! 
– Mostly platform features 
• Windows Charms 
• Sharing 
• Settings
Dealing With Code Differences 
• How can I deal with platform differences? 
– 3 techniques 
• Compiler Directives 
• Abstraction 
• Compiler Directives + Abstraction
Compiler Directives 
• Usage 
– Windows 
• #if WINDOWS_APP 
• NOTE: Was previously NETFX_CORE. Now both platforms define this. 
– Windows Phone 
• #if WINDOWS_PHONE_APP 
• NOTE: Was previously WINDOWS_PHONE 
• Pro 
– Easy 
• Con 
– Can be messy
Abstraction 
• Usage 
– Abstract platform-specific functionality into abstract class or interface 
• Pro 
– Clean 
• Con 
– Can be complex
Compiler Directives + Abstraction 
• Usage 
– Move compiler directives behind abstraction layer 
• Pro 
– Can keep the mess out of view models 
• Con 
– Still can be messy
Navigation
Navigation 
• Much simpler with Universal Apps! 
– Approach is now unified 
• View-driven with 1 optional parameter 
– Parameter can be anything 
• 2 Problems 
1. Logic for navigation is generally in ViewModel 
• ViewModels have to know about Views?!?! 
2. Not easily mocked in unit testing
Navigation 
• Solution 
– Provide abstraction layer for view model driven navigation
Navigation 
[Demo]
Application Settings
Application Settings 
• Store application settings 
– Locally 
• On device only, no sharing 
– Azure 
• Called Roaming Settings 
• Roamed settings can be shared with different platforms 
– In each store, assign same Package Family Name (PFN) to each app 
• http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn630421.aspx 
• Problem 
– Not easily mocked in unit tests
Application Settings 
• Solution 
– Provide abstraction layer
Application Settings 
[Demo]
Secondary Tiles
Secondary Tiles 
• Again, Universal Apps FTW! 
– Unified approach (from code perspective) 
• Main Difference 
– Windows requires user approval to pin/unpin tile 
– Windows Phone does not 
• Does that matter? 
– No! Same code, platforms just act differently 
• Problem 
– Not easily mocked in unit tests (sound familiar?)
Secondary Tiles 
• Solution 
– Provide abstraction layer
Secondary Tiles 
[Demo]
Contracts 
Windows 8.1
Contracts 
• What are they? 
– Agreements between one or more apps 
• Provide consistency across all apps
Examples of Contracts 
• Search 
• Share 
• Settings 
• Play To 
• File Picker 
• Cached File Updater
Contracts 
• Contracts You SHOULD Leverage 
– Search 
– Share 
– Settings 
• You HAVE to use this one with Internet access 
• Why? 
– Always available via Charms menu
Charms Menu
Share 
• Share content from your app 
• Can be context specific 
• Content can be shared in many formats 
– Different apps support different formats 
– Support as many formats as possible 
– Fire and forget
Share 
[Demo]
Settings 
• Change settings in your app 
• Any app-wide settings should go here 
• Users will be conditioned to use this
Settings 
• Things to consider 
– What app-wide settings will you need? 
– How can they be simplified? 
– How will changing them affect the UI? 
• Changes should be reflected immediately 
– Will you use the Internet? 
• If so, you MUST provide a privacy policy
Settings 
[Demo]
Unit testing
Unit Testing 
• Almost the same as .NET 
• Runs right alongside .NET tests in MSTest 
• Biggest Difference? 
– No Reflection.Emit namespace 
• Which means? 
– No mocking frameworks! 
– Have to hand roll all mocks
Unit testing 
[Demo]
What We Covered 
• MVVM 
• Universal Apps 
• Dealing with Code Differences 
• Navigation 
• Application Settings 
• Secondary Tiles 
• Contracts 
• Unit Testing
Questions? 
Please rate session at http://spkr8.com/t/37441!

Contenu connexe

Tendances

Acrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVMAcrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVMDong-Ho Lee
 
Dev-In-Town: Ultimate Data Visualization by Walter Wong
Dev-In-Town: Ultimate Data Visualization by Walter WongDev-In-Town: Ultimate Data Visualization by Walter Wong
Dev-In-Town: Ultimate Data Visualization by Walter WongQuek Lilian
 
Getting started with Xamarin forms
Getting started with Xamarin formsGetting started with Xamarin forms
Getting started with Xamarin formsSolTech, Inc.
 
Architectural Design Pattern: Android
Architectural Design Pattern: AndroidArchitectural Design Pattern: Android
Architectural Design Pattern: AndroidJitendra Kumar
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesQamar Abbas
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009Jonas Follesø
 
Design Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMDesign Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMMudasir Qazi
 
MVVM - Model View ViewModel
MVVM - Model View ViewModelMVVM - Model View ViewModel
MVVM - Model View ViewModelDareen Alhiyari
 
Final presentation
Final presentationFinal presentation
Final presentationdsmo223
 
MVVM with WPF
MVVM with WPFMVVM with WPF
MVVM with WPFS V
 
Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Jennie Gajjar
 
Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksRobert MacLean
 
4Developers 2015: Twoja własna profesjonalna kontrolka WPF - tak jak robią to...
4Developers 2015: Twoja własna profesjonalna kontrolka WPF - tak jak robią to...4Developers 2015: Twoja własna profesjonalna kontrolka WPF - tak jak robią to...
4Developers 2015: Twoja własna profesjonalna kontrolka WPF - tak jak robią to...PROIDEA
 

Tendances (20)

Acrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVMAcrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVM
 
Dev-In-Town: Ultimate Data Visualization by Walter Wong
Dev-In-Town: Ultimate Data Visualization by Walter WongDev-In-Town: Ultimate Data Visualization by Walter Wong
Dev-In-Town: Ultimate Data Visualization by Walter Wong
 
Getting started with Xamarin forms
Getting started with Xamarin formsGetting started with Xamarin forms
Getting started with Xamarin forms
 
Architectural Design Pattern: Android
Architectural Design Pattern: AndroidArchitectural Design Pattern: Android
Architectural Design Pattern: Android
 
MVVM
MVVMMVVM
MVVM
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
 
No brainer
No brainerNo brainer
No brainer
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009
 
Design Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVMDesign Pattern - MVC, MVP and MVVM
Design Pattern - MVC, MVP and MVVM
 
MVVM - Model View ViewModel
MVVM - Model View ViewModelMVVM - Model View ViewModel
MVVM - Model View ViewModel
 
Mvc part 1
Mvc part 1Mvc part 1
Mvc part 1
 
MVC
MVCMVC
MVC
 
What is MVC?
What is MVC?What is MVC?
What is MVC?
 
Final presentation
Final presentationFinal presentation
Final presentation
 
MVVM with WPF
MVVM with WPFMVVM with WPF
MVVM with WPF
 
Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
Visual Studio 2012 introduction
Visual Studio  2012 introductionVisual Studio  2012 introduction
Visual Studio 2012 introduction
 
Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & Tricks
 
4Developers 2015: Twoja własna profesjonalna kontrolka WPF - tak jak robią to...
4Developers 2015: Twoja własna profesjonalna kontrolka WPF - tak jak robią to...4Developers 2015: Twoja własna profesjonalna kontrolka WPF - tak jak robią to...
4Developers 2015: Twoja własna profesjonalna kontrolka WPF - tak jak robią to...
 

En vedette

Educ5105 presentation feb 5
Educ5105 presentation feb 5Educ5105 presentation feb 5
Educ5105 presentation feb 5jaccalder
 
Congress powerpoint (final)
Congress powerpoint (final)Congress powerpoint (final)
Congress powerpoint (final)shaw swafford
 
Differentiated instruction presentation
Differentiated instruction presentationDifferentiated instruction presentation
Differentiated instruction presentationb l
 
Powers of 10
Powers of 10Powers of 10
Powers of 10Earl Cote
 
Netwerken bij MarCom Noord-NL 09 04
Netwerken bij MarCom Noord-NL  09 04Netwerken bij MarCom Noord-NL  09 04
Netwerken bij MarCom Noord-NL 09 04derkeimers
 
words related to greeting
words related to greetingwords related to greeting
words related to greetingC.B. Balaban
 
Electricity and the environment
Electricity and the environment Electricity and the environment
Electricity and the environment jaccalder
 
Savior Skin Template
Savior Skin TemplateSavior Skin Template
Savior Skin TemplateMarcMooney
 
Social Media Week 2012 Panel : Beyond Facebook and Twitter
Social Media Week 2012 Panel : Beyond Facebook and TwitterSocial Media Week 2012 Panel : Beyond Facebook and Twitter
Social Media Week 2012 Panel : Beyond Facebook and TwitterMichoel Ogince
 
проба
пробапроба
пробаKOMBRIG
 
Value Driven Regulatory Use Case Simulation
Value Driven Regulatory Use Case Simulation Value Driven Regulatory Use Case Simulation
Value Driven Regulatory Use Case Simulation Aaron Benningfield
 
Mo Net New Product Presentation May 2012
Mo Net New Product Presentation May 2012Mo Net New Product Presentation May 2012
Mo Net New Product Presentation May 2012Phillip Ichikawa
 
Manitoulin 2014
Manitoulin 2014Manitoulin 2014
Manitoulin 2014jaccalder
 
Mídias sociais 2013 e o que você deve observar
Mídias sociais 2013 e o que você deve observarMídias sociais 2013 e o que você deve observar
Mídias sociais 2013 e o que você deve observarFernando Leroy
 
Comic story (2)
Comic story (2)Comic story (2)
Comic story (2)Ellh
 

En vedette (20)

Educ5105 presentation feb 5
Educ5105 presentation feb 5Educ5105 presentation feb 5
Educ5105 presentation feb 5
 
Jon eta iñigo
Jon eta iñigoJon eta iñigo
Jon eta iñigo
 
Plants(2)
Plants(2)Plants(2)
Plants(2)
 
Congress powerpoint (final)
Congress powerpoint (final)Congress powerpoint (final)
Congress powerpoint (final)
 
Differentiated instruction presentation
Differentiated instruction presentationDifferentiated instruction presentation
Differentiated instruction presentation
 
Powers of 10
Powers of 10Powers of 10
Powers of 10
 
Netwerken bij MarCom Noord-NL 09 04
Netwerken bij MarCom Noord-NL  09 04Netwerken bij MarCom Noord-NL  09 04
Netwerken bij MarCom Noord-NL 09 04
 
words related to greeting
words related to greetingwords related to greeting
words related to greeting
 
Electricity and the environment
Electricity and the environment Electricity and the environment
Electricity and the environment
 
Savior Skin Template
Savior Skin TemplateSavior Skin Template
Savior Skin Template
 
Social Media Week 2012 Panel : Beyond Facebook and Twitter
Social Media Week 2012 Panel : Beyond Facebook and TwitterSocial Media Week 2012 Panel : Beyond Facebook and Twitter
Social Media Week 2012 Panel : Beyond Facebook and Twitter
 
Microwaves
MicrowavesMicrowaves
Microwaves
 
проба
пробапроба
проба
 
Congress powerpoint
Congress powerpointCongress powerpoint
Congress powerpoint
 
Value Driven Regulatory Use Case Simulation
Value Driven Regulatory Use Case Simulation Value Driven Regulatory Use Case Simulation
Value Driven Regulatory Use Case Simulation
 
Mo Net New Product Presentation May 2012
Mo Net New Product Presentation May 2012Mo Net New Product Presentation May 2012
Mo Net New Product Presentation May 2012
 
Manitoulin 2014
Manitoulin 2014Manitoulin 2014
Manitoulin 2014
 
Mídias sociais 2013 e o que você deve observar
Mídias sociais 2013 e o que você deve observarMídias sociais 2013 e o que você deve observar
Mídias sociais 2013 e o que você deve observar
 
Comic story (2)
Comic story (2)Comic story (2)
Comic story (2)
 
resume
resumeresume
resume
 

Similaire à Building a Modern Windows App

Kevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile DevelopmentKevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile DevelopmentAxway Appcelerator
 
Dublin Unity User Group Meetup Sept 2015
Dublin Unity User Group Meetup Sept 2015Dublin Unity User Group Meetup Sept 2015
Dublin Unity User Group Meetup Sept 2015Dominique Boutin
 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for ChangeEric Wyles
 
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Ken Cenerelli
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous IntegrationXPDays
 
Webview: The fifth element
Webview: The fifth elementWebview: The fifth element
Webview: The fifth elementFernando Cejas
 
"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejas"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejaswebcat
 
Universal Apps Oct 2014
Universal Apps Oct 2014Universal Apps Oct 2014
Universal Apps Oct 2014Joe Healy
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchHoward Greenberg
 
Developing a Hybrid Application Management and Deployment Strategy to JBoss a...
Developing a Hybrid Application Management and Deployment Strategy to JBoss a...Developing a Hybrid Application Management and Deployment Strategy to JBoss a...
Developing a Hybrid Application Management and Deployment Strategy to JBoss a...XebiaLabs
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Ivano Malavolta
 
Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Sean McCullough
 
Devops - why, what and how?
Devops - why, what and how?Devops - why, what and how?
Devops - why, what and how?Malinda Kapuruge
 
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014Phil Leggetter
 
The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1Teamstudio
 
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...Derek Ashmore
 
ITPROCEED_WorkplaceMobility_Creating a seamless experience with ue v and wind...
ITPROCEED_WorkplaceMobility_Creating a seamless experience with ue v and wind...ITPROCEED_WorkplaceMobility_Creating a seamless experience with ue v and wind...
ITPROCEED_WorkplaceMobility_Creating a seamless experience with ue v and wind...ITProceed
 
Building software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard ThulinBuilding software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard ThulinRikard Thulin
 

Similaire à Building a Modern Windows App (20)

Kevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile DevelopmentKevin Whinnery: Best Practices for Cross-Platform Mobile Development
Kevin Whinnery: Best Practices for Cross-Platform Mobile Development
 
Dublin Unity User Group Meetup Sept 2015
Dublin Unity User Group Meetup Sept 2015Dublin Unity User Group Meetup Sept 2015
Dublin Unity User Group Meetup Sept 2015
 
Twelve Factor - Designing for Change
Twelve Factor - Designing for ChangeTwelve Factor - Designing for Change
Twelve Factor - Designing for Change
 
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
Maximizing code reuse between Windows Phone 8 and Windows 8 (That Conference ...
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Webview: The fifth element
Webview: The fifth elementWebview: The fifth element
Webview: The fifth element
 
"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejas"WebView, the fifth element" por @fernando_cejas
"WebView, the fifth element" por @fernando_cejas
 
Desktop Intro
Desktop IntroDesktop Intro
Desktop Intro
 
Universal Apps Oct 2014
Universal Apps Oct 2014Universal Apps Oct 2014
Universal Apps Oct 2014
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
 
Visual Basic User Interface-III
Visual Basic User Interface-IIIVisual Basic User Interface-III
Visual Basic User Interface-III
 
Developing a Hybrid Application Management and Deployment Strategy to JBoss a...
Developing a Hybrid Application Management and Deployment Strategy to JBoss a...Developing a Hybrid Application Management and Deployment Strategy to JBoss a...
Developing a Hybrid Application Management and Deployment Strategy to JBoss a...
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app
 
Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014
 
Devops - why, what and how?
Devops - why, what and how?Devops - why, what and how?
Devops - why, what and how?
 
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
 
The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1
 
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
Application Deployment Patterns in the Cloud - NOVA Cloud and Software Engine...
 
ITPROCEED_WorkplaceMobility_Creating a seamless experience with ue v and wind...
ITPROCEED_WorkplaceMobility_Creating a seamless experience with ue v and wind...ITPROCEED_WorkplaceMobility_Creating a seamless experience with ue v and wind...
ITPROCEED_WorkplaceMobility_Creating a seamless experience with ue v and wind...
 
Building software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard ThulinBuilding software using Rich Clients Platforms Rikard Thulin
Building software using Rich Clients Platforms Rikard Thulin
 

Dernier

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Dernier (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

Building a Modern Windows App

  • 1. Building a Modern Windows App Brent Edwards Principal Lead Consultant BrentE@magenic.com @brentledwards brentedwards.net https://github.com/brentedwards
  • 2. November 17-21 Royal Pacific Resort at Universal Orlando, FL More info: http://modernappslive.com Register and save money: http://bit.ly/LSPK27REG
  • 3. What We Will Cover • MVVM • Universal Apps • Dealing with Code Differences • Navigation • Application Settings • Secondary Tiles • Contracts • Unit Testing
  • 5. Charmed Framework • Open source, Windows-based MVVM support library – Windows 8.1 – Windows Phone 8.1 – Updated to Universal Apps • https://github.com/brentedwards/Charmed
  • 9. Why is MVVM Cool? • Separates Presentation from Functionality • Promotes Testability • Works great with Data Binding • Easy collaboration with Designers • Makes it easy to change out the View layer!
  • 11. Universal Apps • What are they? – One codebase to rule them all (on Windows, anyway) Source: https://dev.windows.com/en-us/develop/building-universal-Windows-apps
  • 12. Universal Apps • Project type that came with Visual Studio 2013 Update 2
  • 13. Universal Apps • Introduces concept of Universal Shared Project type – Essentially a code placeholder project • Does not compile on its own
  • 14. Universal Shared Projects • Put common code in universal shared project – Platform-specific code in platform-specific projects • What is common? – Models – ViewModels – Converters – Services • What about views? – That depends…
  • 15. Universal Shared Projects • A helpful Visual Studio extension – Shared Project Reference Manager • http://visualstudiogallery.msdn.microsoft.com/315c13a7-2787-4f57-bdf7-adae6ed54450
  • 16. Dealing With Code Differences
  • 17. Dealing With Code Differences • What is different? – Not a lot anymore! – Mostly platform features • Windows Charms • Sharing • Settings
  • 18. Dealing With Code Differences • How can I deal with platform differences? – 3 techniques • Compiler Directives • Abstraction • Compiler Directives + Abstraction
  • 19. Compiler Directives • Usage – Windows • #if WINDOWS_APP • NOTE: Was previously NETFX_CORE. Now both platforms define this. – Windows Phone • #if WINDOWS_PHONE_APP • NOTE: Was previously WINDOWS_PHONE • Pro – Easy • Con – Can be messy
  • 20. Abstraction • Usage – Abstract platform-specific functionality into abstract class or interface • Pro – Clean • Con – Can be complex
  • 21. Compiler Directives + Abstraction • Usage – Move compiler directives behind abstraction layer • Pro – Can keep the mess out of view models • Con – Still can be messy
  • 23. Navigation • Much simpler with Universal Apps! – Approach is now unified • View-driven with 1 optional parameter – Parameter can be anything • 2 Problems 1. Logic for navigation is generally in ViewModel • ViewModels have to know about Views?!?! 2. Not easily mocked in unit testing
  • 24. Navigation • Solution – Provide abstraction layer for view model driven navigation
  • 27. Application Settings • Store application settings – Locally • On device only, no sharing – Azure • Called Roaming Settings • Roamed settings can be shared with different platforms – In each store, assign same Package Family Name (PFN) to each app • http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn630421.aspx • Problem – Not easily mocked in unit tests
  • 28. Application Settings • Solution – Provide abstraction layer
  • 31. Secondary Tiles • Again, Universal Apps FTW! – Unified approach (from code perspective) • Main Difference – Windows requires user approval to pin/unpin tile – Windows Phone does not • Does that matter? – No! Same code, platforms just act differently • Problem – Not easily mocked in unit tests (sound familiar?)
  • 32. Secondary Tiles • Solution – Provide abstraction layer
  • 35. Contracts • What are they? – Agreements between one or more apps • Provide consistency across all apps
  • 36. Examples of Contracts • Search • Share • Settings • Play To • File Picker • Cached File Updater
  • 37. Contracts • Contracts You SHOULD Leverage – Search – Share – Settings • You HAVE to use this one with Internet access • Why? – Always available via Charms menu
  • 39. Share • Share content from your app • Can be context specific • Content can be shared in many formats – Different apps support different formats – Support as many formats as possible – Fire and forget
  • 41. Settings • Change settings in your app • Any app-wide settings should go here • Users will be conditioned to use this
  • 42. Settings • Things to consider – What app-wide settings will you need? – How can they be simplified? – How will changing them affect the UI? • Changes should be reflected immediately – Will you use the Internet? • If so, you MUST provide a privacy policy
  • 45. Unit Testing • Almost the same as .NET • Runs right alongside .NET tests in MSTest • Biggest Difference? – No Reflection.Emit namespace • Which means? – No mocking frameworks! – Have to hand roll all mocks
  • 47. What We Covered • MVVM • Universal Apps • Dealing with Code Differences • Navigation • Application Settings • Secondary Tiles • Contracts • Unit Testing
  • 48. Questions? Please rate session at http://spkr8.com/t/37441!