Windows Phone 7 Silverlight MVVM App the Test-Driven

18
Windows Phone 7 Silverlight MVVM App the Test-Driven Way Mark Tucker Desert Code Camp, May 2010

description

Windows Phone 7 Silverlight MVVM App the Test-Driven

Transcript of Windows Phone 7 Silverlight MVVM App the Test-Driven

Page 1: Windows Phone 7 Silverlight MVVM App the Test-Driven

Windows Phone 7 Silverlight MVVM App the Test-Driven Way

Mark TuckerDesert Code Camp, May

2010

Page 2: Windows Phone 7 Silverlight MVVM App the Test-Driven

Windows Phone 7

Page 3: Windows Phone 7 Silverlight MVVM App the Test-Driven

Application Platform

Page 4: Windows Phone 7 Silverlight MVVM App the Test-Driven

3 Screens + Cloud

Page 5: Windows Phone 7 Silverlight MVVM App the Test-Driven

Standardized Hardware

• WVGA (800x480), capacitive 4-point multi-touch screen

• DirectX 9 hardware acceleration • Sensors - GPS, accelerometer, compass,

light, proximity • Camera• Buttons – Start, Search, Back• Connectivity – cell & Wi-Fi• 256 MB (or more) of RAM and 8 GB (or

more) of flash storage

Page 6: Windows Phone 7 Silverlight MVVM App the Test-Driven

MVVM

Model View

ViewModel

Commands

DataBinding

Page 7: Windows Phone 7 Silverlight MVVM App the Test-Driven

TDD

REDGREE

NREFACTOR

Page 8: Windows Phone 7 Silverlight MVVM App the Test-Driven

Silverlight Unit Testing Framework

• Used by Silverlight Toolkit http://code.msdn.microsoft.com/silverlightut

• WP7-specific build http://jeffatmix.com/

• MIX10 session – CL59• Based on Microsoft Unit Testing

framework

Page 9: Windows Phone 7 Silverlight MVVM App the Test-Driven

MVVM Light Toolkit

• View• ViewModelLocator• ViewModel• RelayCommand• EventToCommand• Messenger

Page 10: Windows Phone 7 Silverlight MVVM App the Test-Driven

Design – nba tracker

Page 11: Windows Phone 7 Silverlight MVVM App the Test-Driven

Design – nba tracker

© 2005-2009 Clarity Consulting

http://blogs.claritycon.com/blogs/design/archive/2010/04/01/designing-for-win-phone-7.aspx

Page 12: Windows Phone 7 Silverlight MVVM App the Test-Driven

Design – quick journal

Page 13: Windows Phone 7 Silverlight MVVM App the Test-Driven

Map to MVVM

MainPage (View) MainViewModel

ApplicationTitle

ListName

Notes

ShowDetailCommand(note)

Binding

Command

Page 14: Windows Phone 7 Silverlight MVVM App the Test-Driven

Map to MVVM

DetailView DetailViewModel

ApplicationTitle

ListName

ShortDate

SaveDetailCommand

Binding

Command

Text

CancelDetailCommand

Page 15: Windows Phone 7 Silverlight MVVM App the Test-Driven

DEMO

• Phone Parallax – Panoramic • Picture Viewer – Panoramic• Weather Forecast – Pivot • MEF, MVVM• Quick Journal

Page 16: Windows Phone 7 Silverlight MVVM App the Test-Driven

Resources• Developer Portal

http://developer.windowsphone.com/– UI Design and Interaction Guide– Application Bar Icons

• MIX10 Sessions (15 total) http://live.visitmix.com/Sessions#/tags/WindowsPhone

• Training Kit http://channel9.msdn.com/learn/courses/WP7TrainingKit/

• UI Design Templates http://www.shazaml.com/archives/windows-phone-7-ui-templates

• Free e-book by Charles Petzold http://www.charlespetzold.com/

• Twitter @wp7dev

Page 17: Windows Phone 7 Silverlight MVVM App the Test-Driven

Timeline

• March 15 – announcement at MIX10• April 12 – VS 2010 release• April 29 – Refresh for VS 2010• 6 months to develop some COOL

apps• Holiday 2010 – Phones available

Page 18: Windows Phone 7 Silverlight MVVM App the Test-Driven

Contact Me

• Twitter: @marktucker• Blog: www.shazaml.com