Download - MVVM in Windows Phone 7
7
NameTitleMicrosoft Corporation
MVVM in Windows Phone 7
Windows Phone Microsoft confidential. 2
MVVM – In a nutshell
“…building UIs that utilize platform enhancements in WPF and Silverlight to provide good separation between UI and business logic in order to make those UIs easier to maintain by developers and designers.”
- Glenn Block
Windows Phone Microsoft confidential. 3
Key elements of MVVM Data
Binding
Data Templates
Commands
Attached Properties
Behaviors
Windows Phone Microsoft confidential. 4
MVVM toolkits for WP7 Homegrown
Ships with template MVVM Light
http://mvvmlight.codeplex.com NRoute
http://nroute.codeplex.com Caliburn
http://caliburn.codeplex.com
Data Binding
Commands
Messages
View
Model
ViewModel
Windows Phone Microsoft confidential. 5
MVVM toolkits for WP7 ViewModelLocator ViewModel DispatcherHelper RelayCommand EventToCommand Messenger
“Blendability”
Demo - Getting Started
Windows Phone Microsoft confidential. 7
Relay Command Used to send messages from the View to
the ViewModel Bind actions on View to Commands on
ViewModel Based on the familiar Command pattern
ICommand Command Parameters CanExecute Attached Properties
Windows Phone Microsoft confidential. 8
EventToCommand Blend Behavior for wiring up
RelayCommands
Demo - Commands
Windows Phone Microsoft confidential. 10
Messaging
© 2010 IdentityMine Inc. Used with permission
View
ViewModel
Messages
Messages+ callback
View
ViewModel
View
ViewModel
Demo – Messaging
Q&A
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.