Getting Startedwith MVVM in(WPF / Silverlight)NISHANTH ANILTECHNICAL EVANGELIST   @nishanil | nanil@infragistics.com | nni...
Agenda– Patterns– What’s MVVM?– Foundation (WPF concepts)– Available Frameworks– Your First ViewModel (demo)– Simple Dashb...
Patterns – are guidelines not rules!• UI patterns   –   Model – View – Controller   –   Model – View – Presenter   –   Pre...
MVVM       @nishanil
Foundation – WPF Concepts•   INotifyPropertyChanged/INotifyCollectionChanged•   DataContext•   DataBinding•   Commanding  ...
Foundation – WPF Concepts•   INotifyPropertyChanged     – Not a WPF only concept (part of an implementation of GOF Observe...
Foundation – WPF Concepts• DataBinding   – A View binds to properties on a ViewModel• DataContext   – Set ViewModel to the...
Foundation – WPF Concepts• Commanding    – Is an input mechanism    – Without command MVVM will be less powerful    – Comm...
Available FrameworksSource: Wikipedia, As on 31st OCT 2012   @nishanil
Some helper files• MVVM Foundation  – http://mvvmfoundation.codeplex.com/  – ObservableObject Class  – RelayCommand       ...
Demo• Writing your first ViewModel• A simple Sales dashboard                                 @nishanil
Silverlight: MVVM + RIA                          @nishanil
Resources• Introduction to Model/View/ViewModel pattern for building  WPF apps (John Gossman)   – http://blogs.msdn.com/b/...
Q&ANISHANTH ANILTECHNICAL EVANGELIST   @nishanil | nanil@infragistics.com | nnish.comfacebook.com/InfragisticsIndia
Infragistics: Getting Started with MVVM in WPF & Silverlight
Upcoming SlideShare
Loading in …5
×

Infragistics: Getting Started with MVVM in WPF & Silverlight

1,621 views

Published on

OCT 31 Webinar Slides

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,621
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Infragistics: Getting Started with MVVM in WPF & Silverlight

  1. 1. Getting Startedwith MVVM in(WPF / Silverlight)NISHANTH ANILTECHNICAL EVANGELIST @nishanil | nanil@infragistics.com | nnish.comfacebook.com/InfragisticsIndia
  2. 2. Agenda– Patterns– What’s MVVM?– Foundation (WPF concepts)– Available Frameworks– Your First ViewModel (demo)– Simple Dashboard (demo) @nishanil
  3. 3. Patterns – are guidelines not rules!• UI patterns – Model – View – Controller – Model – View – Presenter – Presentation Model – Model – View – ViewModel• Why do they exist? – Separation of concerns – Testability – Maintainability @nishanil
  4. 4. MVVM @nishanil
  5. 5. Foundation – WPF Concepts• INotifyPropertyChanged/INotifyCollectionChanged• DataContext• DataBinding• Commanding @nishanil
  6. 6. Foundation – WPF Concepts• INotifyPropertyChanged – Not a WPF only concept (part of an implementation of GOF Observer pattern) • Observer Pattern in brief: When one object changes state, all its dependents are notified and updated automatically. – Implement INotifyPropertyChanged in your ViewModels – And Notify when property changes• INotifyCollectionChanged – Similar to INotifyProperyChanged, but it applies to collections of objects – Use ObservableCollection<T> instead of manually implementing @nishanil
  7. 7. Foundation – WPF Concepts• DataBinding – A View binds to properties on a ViewModel• DataContext – Set ViewModel to the DataContext of the View – This property is meant to be set to the data object it visualizes. @nishanil
  8. 8. Foundation – WPF Concepts• Commanding – Is an input mechanism – Without command MVVM will be less powerful – Commands in WPF are implemented using ICommand interfaceICommand Implementation ViewModel Binding the command in the View @nishanil
  9. 9. Available FrameworksSource: Wikipedia, As on 31st OCT 2012 @nishanil
  10. 10. Some helper files• MVVM Foundation – http://mvvmfoundation.codeplex.com/ – ObservableObject Class – RelayCommand @nishanil
  11. 11. Demo• Writing your first ViewModel• A simple Sales dashboard @nishanil
  12. 12. Silverlight: MVVM + RIA @nishanil
  13. 13. Resources• Introduction to Model/View/ViewModel pattern for building WPF apps (John Gossman) – http://blogs.msdn.com/b/johngossman/archive/2005/10/08/478683.a spx• WPF Apps With The Model-View-ViewModel Design Pattern (Josh Smith) – http://msdn.microsoft.com/en-us/magazine/dd419663.aspx• Infragistics Community – http://www.infragistics.com/community/blogs/• Infragistics WPF Products - http://www.infragistics.com/products/wpf/• Infragistics Silverlight Products - http://www.infragistics.com/products/silverlight/ @nishanil
  14. 14. Q&ANISHANTH ANILTECHNICAL EVANGELIST @nishanil | nanil@infragistics.com | nnish.comfacebook.com/InfragisticsIndia

×