Presentation Model      The First Contact
Agenda   Quick Introduction   Why should I care about it?   View Model   XAML   Data Binding   ViewModel Base   Com...
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 thesynchronization between Presentation Mo...
Model – View – ViewModel Technology specific implementation of the PM Separation of Markup and Code Behaviour of the Ap...
“Once a developer becomes comfortablewith WPF and MVVM, it can be difficultto differentiate the two. ”. Josh Smith, MVVM G...
Why should I care about it? Order vs. Chaos Technology Choice Loose Coupling Testability (DEMO) Maintainable Code Bl...
<Disclaimer> No Solution is Perfect Different Approaches    View-Centric    ViewModel Centric                         ...
View Model Separation of Concerns Enables code reuse State + Operations Provides a Bindable Surface Not Dependent on ...
XAML Humble View Plays nicely with Data Binding  capabilities
Data Binding Binding Expression Binding Direction Binding to Elements Binding to Templates RelativeSource
DEMO
Commands Delegate Command vs. Relay Command (DEMO) Uses WPF Behaviours capabilities Map Events to Commands (DEMO)
DEMO
Validation Implemented on ViewModel, not in Model Class
DEMO
Messaging Uses a light message bus to communicate between components Publish/Subscribe Frameworks (MVVM Light) (DEMO)
DEMOMVVM Light Toolkit
ViewModel Locator Repository of ViewModels Uses WPF DataTemplate Capabilities One View per ViewModel MVVM Light
DEMOMVVM Light Toolkit
Trade-Offs Agregate Model vs Proxy Property Start animation on the View through ViewModel How to close a window Clean ...
And continues…Not used only with WPF/Silverlight: ASP.NET MVC Knockout.js Java frameworks (RLY?)                       ...
Upcoming SlideShare
Loading in …5
×

Presentation Model

464 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
464
On SlideShare
0
From Embeds
0
Number of Embeds
16
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • MVC:
  • Presentation Model

    1. 1. Presentation Model The First Contact
    2. 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…?
    3. 3. Quick Introduction: Presentation Patterns
    4. 4. UI Patterns Comparison Passive View Supervising Controller Presentation Model
    5. 5. Presentation Model“Probably the most annoying part of the Presentation Model is thesynchronization between Presentation Model and view. It’s simple codeto write, but I always like to minimize this kind of boring repetitivecode.Ideally some kind of framework could handle this, which I’m hoppingwill happen some day with technologies like .NET’s data binding.” Martin Fowler, 2004.
    6. 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. 7. “Once a developer becomes comfortablewith WPF and MVVM, it can be difficultto differentiate the two. ”. Josh Smith, MVVM Guru
    8. 8. Why should I care about it? Order vs. Chaos Technology Choice Loose Coupling Testability (DEMO) Maintainable Code Blendability (DEMO) It is cool
    9. 9. <Disclaimer> No Solution is Perfect Different Approaches  View-Centric  ViewModel Centric </Disclaimer>
    10. 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. 11. XAML Humble View Plays nicely with Data Binding capabilities
    12. 12. Data Binding Binding Expression Binding Direction Binding to Elements Binding to Templates RelativeSource
    13. 13. DEMO
    14. 14. Commands Delegate Command vs. Relay Command (DEMO) Uses WPF Behaviours capabilities Map Events to Commands (DEMO)
    15. 15. DEMO
    16. 16. Validation Implemented on ViewModel, not in Model Class
    17. 17. DEMO
    18. 18. Messaging Uses a light message bus to communicate between components Publish/Subscribe Frameworks (MVVM Light) (DEMO)
    19. 19. DEMOMVVM Light Toolkit
    20. 20. ViewModel Locator Repository of ViewModels Uses WPF DataTemplate Capabilities One View per ViewModel MVVM Light
    21. 21. DEMOMVVM Light Toolkit
    22. 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. 23. And continues…Not used only with WPF/Silverlight: ASP.NET MVC Knockout.js Java frameworks (RLY?) To Far and Beyond… That’s it ;-)

    ×