10
Practical MVVM Joel Cochran

Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF) mailto:[email protected]

Embed Size (px)

Citation preview

Page 1: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

Practical MVVM

Joel Cochran

Page 2: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

About Me

Expression Blend MVP

INETA Community ChampionMCTS (WinForms & WPF)http://www.developingfor.netmailto:[email protected]: @joelcochran

http://speakerwiki.org/speakers/joel_cochran

Page 3: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

Announcing Blend SIG

Virtual User Group

http://blendsig.groups.live.comtwitter: @blendsig

2nd Wednesday of each month, 2pm ESTVideos: http://vimeo.com/blendisg

Coming soon: http://blendsig.com

Presenters are deep Blend Experts

Page 4: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

My Book!

MEAP available now

http://manning.com/cochran

Published Fall 2011

A developer’s guide

Page 5: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

MVVM: Practical Magic?Model, View, ViewModelSimilar to other MVx patternsBig exception: 2 way

communications between View and ViewModel

Allows true separation of concerns

Supports DataBindingNo Code Behind

Page 6: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

MVVM Parts: Model

The Data

Data Services

XML Files

ADO.NET, LinqToSQL, EF

Consumed by ViewModel(s)

Unaware of View and ViewModel

Page 7: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

MVVM Parts: View

The Screen

UI and UX

Visual Representation of the DataWPF, Silverlight, WP7

Populated by ViewModel(s)

Unaware of the Model

Technically unaware of the ViewModel

Page 8: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

MVVM Parts: ViewModel

The Master & The MiddlemanCommunications

Management

Data formatting

Action items

Unaware of View

Page 9: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

Model

Data Binding .

MVVM Parts: ViewModel

Data Source

Model Entities

ViewModel

Code Behind

View

ViewModel

Code Behind

View

ViewModel

Code Behind

View

Data Access Service

Model

ViewModel

View

Page 10: Practical MVVM. About Me Expression Blend MVP INETA Community Champion MCTS (WinForms & WPF)  mailto:joelcochran@gmail.com

The Practical MVVM Manifesto

Must be simple and discoverableMust support Blend

Must provide design time dataMust be testable