SlideShare a Scribd company logo
Presentation Model
      The First Contact
Agenda
   Quick Introduction
   Why should I care about it?
   View Model
   XAML
   Data Binding
   ViewModel Base
   Commands
   Validation
   Data Templates
   Resource Systems
   MVVM Framework
   How do I do…?
Quick Introduction: Presentation Patterns
UI Patterns Comparison
 Passive View
 Supervising Controller
 Presentation Model
Presentation Model
“Probably the most annoying part of the Presentation Model is the
synchronization between Presentation Model and view. It’s simple code
to write, but I always like to minimize this kind of boring repetitive
code.
Ideally some kind of framework could handle this, which I’m hopping
will happen some day with technologies like .NET’s data binding.”
                                                        Martin Fowler, 2004.
Model – View – ViewModel
 Technology specific implementation of the PM
 Separation of Markup and Code
 Behaviour of the Application
 Look and Feel
 Tool Support
“Once a developer becomes comfortable
with WPF and MVVM, it can be difficult
to differentiate the two. ”. Josh Smith, MVVM Guru
Why should I care about it?
 Order vs. Chaos
 Technology Choice
 Loose Coupling
 Testability (DEMO)
 Maintainable Code
 Blendability (DEMO)
 It is cool
<Disclaimer>
 No Solution is Perfect
 Different Approaches
    View-Centric
    ViewModel Centric




                           </Disclaimer>
View Model
 Separation of Concerns
 Enables code reuse
 State + Operations
 Provides a Bindable Surface
 Not Dependent on the View
 Typically One-To-One ViewModel to View
   One-To-Many is very common though
XAML
 Humble View
 Plays nicely with Data Binding
  capabilities
Data Binding
 Binding Expression
 Binding Direction
 Binding to Elements
 Binding to Templates
 RelativeSource
DEM
O
Commands
 Delegate Command vs. Relay Command (DEMO)
 Uses WPF Behaviours capabilities
 Map Events to Commands (DEMO)
DEM
O
Validation
 Implemented on ViewModel, not in Model Class
DEM
O
Messaging
 Uses a light message bus to communicate between components
 Publish/Subscribe
 Frameworks (MVVM Light) (DEMO)
DEM
O
MVVM Light Toolkit
ViewModel Locator
 Repository of ViewModels
 Uses WPF DataTemplate Capabilities
 One View per ViewModel
 MVVM Light
DEM
O
MVVM Light Toolkit
Trade-Offs
 Agregate Model vs Proxy Property
 Start animation on the View through ViewModel
 How to close a window
 Clean and Shutdown
 Handle Navigation
 Add your own topic to be discussed…
And continues…
Not used only with WPF/Silverlight:
 ASP.NET MVC
 Knockout.js
 Java frameworks (RLY?)




                                      To Far and Beyond… That’s it ;-)

More Related Content

PPTX
PPTX
MVVM with WPF
 
PPTX
Stephen Kennedy Silverlight 3 Deep Dive
PPTX
Javascript from beginning to modern
PPTX
We love XAML - Blend for Windows och Phone development - TechDays Sweden 2014
PPTX
Design Pattern - MVC, MVP and MVVM
PDF
MVC Seminar Presantation
MVVM with WPF
 
Stephen Kennedy Silverlight 3 Deep Dive
Javascript from beginning to modern
We love XAML - Blend for Windows och Phone development - TechDays Sweden 2014
Design Pattern - MVC, MVP and MVVM
MVC Seminar Presantation

What's hot (7)

PDF
Reactive Guide for Spring MVC - Rossen Stoyanchev
ODP
What is MVC?
PPT
Why MVC?
PPTX
Mvc fundamental
PPT
MVC(Model View Controller),Web,Enterprise,Mobile
PPT
Ppt of Basic MVC Structure
PPTX
Presentation Thesis
Reactive Guide for Spring MVC - Rossen Stoyanchev
What is MVC?
Why MVC?
Mvc fundamental
MVC(Model View Controller),Web,Enterprise,Mobile
Ppt of Basic MVC Structure
Presentation Thesis
Ad

Similar to Presentation Model (20)

PPTX
Mvvm in the real world tccc10
PPTX
Adopting MVVM
PDF
Introduction To MVVM
PPTX
MVVM Design Pattern NDC2009
PPTX
Understanding The MVVM Pattern (TechDays Belgium)
PPTX
Introduction to WPF and MVVM
PPTX
WPF For Beginners - Learn in 3 days
PPTX
MVVM ( Model View ViewModel )
PPTX
Advanced MVVM in Windows 8
PPTX
Training: MVVM Pattern
PPT
Model View ViewModel
PPTX
Applied MVVM in Windows 8 apps: not your typical MVVM session!
PPTX
MVVM - Model View ViewModel
PPTX
MVVM and Prism
PPTX
Introduction to MVVM Framework
PPTX
WPF with MVVM: From the Trenches
PPTX
Introduction to XAML and its features
PPTX
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
PDF
Portable Class Libraries and MVVM
PDF
MVVM Light Toolkit Works Great, Less Complicated
Mvvm in the real world tccc10
Adopting MVVM
Introduction To MVVM
MVVM Design Pattern NDC2009
Understanding The MVVM Pattern (TechDays Belgium)
Introduction to WPF and MVVM
WPF For Beginners - Learn in 3 days
MVVM ( Model View ViewModel )
Advanced MVVM in Windows 8
Training: MVVM Pattern
Model View ViewModel
Applied MVVM in Windows 8 apps: not your typical MVVM session!
MVVM - Model View ViewModel
MVVM and Prism
Introduction to MVVM Framework
WPF with MVVM: From the Trenches
Introduction to XAML and its features
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
Portable Class Libraries and MVVM
MVVM Light Toolkit Works Great, Less Complicated
Ad

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Electronic commerce courselecture one. Pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Encapsulation theory and applications.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPT
Teaching material agriculture food technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
MYSQL Presentation for SQL database connectivity
Encapsulation_ Review paper, used for researhc scholars
Dropbox Q2 2025 Financial Results & Investor Presentation
Electronic commerce courselecture one. Pdf
A comparative analysis of optical character recognition models for extracting...
Reach Out and Touch Someone: Haptics and Empathic Computing
Digital-Transformation-Roadmap-for-Companies.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Unlocking AI with Model Context Protocol (MCP)
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence
Encapsulation theory and applications.pdf
Big Data Technologies - Introduction.pptx
Teaching material agriculture food technology
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MYSQL Presentation for SQL database connectivity

Presentation Model

  • 1. Presentation Model The First Contact
  • 2. Agenda  Quick Introduction  Why should I care about it?  View Model  XAML  Data Binding  ViewModel Base  Commands  Validation  Data Templates  Resource Systems  MVVM Framework  How do I do…?
  • 4. UI Patterns Comparison  Passive View  Supervising Controller  Presentation Model
  • 5. Presentation Model “Probably the most annoying part of the Presentation Model is the synchronization between Presentation Model and view. It’s simple code to write, but I always like to minimize this kind of boring repetitive code. Ideally some kind of framework could handle this, which I’m hopping will happen some day with technologies like .NET’s data binding.” Martin Fowler, 2004.
  • 6. Model – View – ViewModel  Technology specific implementation of the PM  Separation of Markup and Code  Behaviour of the Application  Look and Feel  Tool Support
  • 7. “Once a developer becomes comfortable with WPF and MVVM, it can be difficult to differentiate the two. ”. Josh Smith, MVVM Guru
  • 8. Why should I care about it?  Order vs. Chaos  Technology Choice  Loose Coupling  Testability (DEMO)  Maintainable Code  Blendability (DEMO)  It is cool
  • 9. <Disclaimer>  No Solution is Perfect  Different Approaches  View-Centric  ViewModel Centric </Disclaimer>
  • 10. View Model  Separation of Concerns  Enables code reuse  State + Operations  Provides a Bindable Surface  Not Dependent on the View  Typically One-To-One ViewModel to View  One-To-Many is very common though
  • 11. XAML  Humble View  Plays nicely with Data Binding capabilities
  • 12. Data Binding  Binding Expression  Binding Direction  Binding to Elements  Binding to Templates  RelativeSource
  • 13. DEM O
  • 14. Commands  Delegate Command vs. Relay Command (DEMO)  Uses WPF Behaviours capabilities  Map Events to Commands (DEMO)
  • 15. DEM O
  • 16. Validation  Implemented on ViewModel, not in Model Class
  • 17. DEM O
  • 18. Messaging  Uses a light message bus to communicate between components  Publish/Subscribe  Frameworks (MVVM Light) (DEMO)
  • 20. ViewModel Locator  Repository of ViewModels  Uses WPF DataTemplate Capabilities  One View per ViewModel  MVVM Light
  • 22. Trade-Offs  Agregate Model vs Proxy Property  Start animation on the View through ViewModel  How to close a window  Clean and Shutdown  Handle Navigation  Add your own topic to be discussed…
  • 23. And continues… Not used only with WPF/Silverlight:  ASP.NET MVC  Knockout.js  Java frameworks (RLY?) To Far and Beyond… That’s it ;-)

Editor's Notes