0% found this document useful (0 votes)
2K views12 pages

MVVM Pattern in WPF

1. The document discusses the DataModel-View-ViewModel (DMVVM) pattern in WPF, which separates an application's data, view, and logic into three separate classes. 2. The ViewModel acts as an abstraction of the View and implements UI logic, while binding the View to the DataModel. 3. DMVVM allows for separation of concerns, simple unit testing, and easy re-skinning of user interfaces.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views12 pages

MVVM Pattern in WPF

1. The document discusses the DataModel-View-ViewModel (DMVVM) pattern in WPF, which separates an application's data, view, and logic into three separate classes. 2. The ViewModel acts as an abstraction of the View and implements UI logic, while binding the View to the DataModel. 3. DMVVM allows for separation of concerns, simple unit testing, and easy re-skinning of user interfaces.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

DataModel-ViewViewModel in WPF

Filling the Gap Between the Presentation and View

A Little Background
John Blumenauer Started with .NET 1.0 Works at Metrico Wireless Enjoys talking and learning about .NET

In the Remaining 28 Minutes


Goals
Understand DataModel-View-ViewModel Learn why WPF and DMVVM work well together. See it in action!

So Where Did it Come From?


DataModel-View-ViewModel Sometimes called Model-View-ViewModel Martin Fowlers Presentation Model is similar. John Gossman of MSFT Published it 1st. Dan Crevier of MSFT also contributed with a multi-part series.

So What Does it Do?


DataModel
Objects representing problem domain.

View
UI controls that display things

ViewModel
UI-friendly objects implement UI-specific interfaces Stores the UI data and state Application code works with VM objects, not UI

The DMVVM Pattern


View

ViewModel

DataModel

Data Access

DMVVM has Classic Roots


MVC and MVP serve as the DMVVM basis ViewModel is a morph of the classic Controller/Presenter Model and View is joined by the ViewModel. ViewModel is an abstraction of a View.

So Why Does WPF and DMVVM Work Together so Well?


In a wordDatabinding

View and ViewModel are joined by binding.


View initiates Commands and requests actions from a bound ViewModel

So Whats the Cost/Benefit?


Cost
Learning Curve Development Time

Benefits
Great Separation Simple Unit Testing UI Design and Workflow UI can be Easily Re-Skinned

Demo/Sample Code

Summary
DMVVM = DataModel-View-ViewModel Databinding is Key. View is not attached to logic, only ViewModel ViewModel is an Abstraction of a View.

Related Links
John Gossman Tales from the Smart Client http://blogs.msdn.com/johngossman Dan Creviers Blog http://blogs.msdn.com/dancre/archive/2006/07/ 23/676272.aspx Josh Smith Inside XamSalesManager http://community.infragistics.com/articles/appli cation-design/inside-xamsalesmanager3.aspx#mod The Orbifold http://www.orbifold.net/default/?p=550

You might also like