Upload
felipe-pimentel
View
1.600
Download
6
Embed Size (px)
DESCRIPTION
Citation preview
Model View ViewModel
Felipe PimentelFelipe Pimentel
Felipe Pimentel
[email protected]@2pc.com.brhttp://felipepimentel.net
Felipe Pimentel
Agenda
• O que é?• O que faz?• Quando usar?• Variações?• Light Toolkit• Demo!!!
“Mais outro M* alguma coisa?”MVPMVC
MV?????
O que é MVVM?
• Padrão de arquitetura de apresentação• Separando responsabilidades• Isolar designers e desenvolvedores?• Facilita os testes
Por que do MVVM?
• Fatores tecnologicos– Databinds– INotifyPropertyChanged– IValueConverter–Modelo de eventos utilizando ICommand
MVVM
Model View
Presentation Model
(ViewModel)
DataBinding
ModelMVVM
• Represents the data• The entity• Not required to know where it gets its data
from– From a WCF service. WCF RIA Services, etc
• May contain validation
ViewMVVM
• The screen, the UI, the UserControl in Silverlight• Handles UI look and feel• Presentation of information• Communicates with ViewModel through bindings
ViewModelMVVM
• Conhecido por Presenter Model• Main source of logic for the MVVM triad• Connects the Model to the View• Abstracts the View• Public properties that are bound to a View• INotifyPropertyChanged and INotifyCollectionChanged
talk to the View through bindings• Listens for changes from the View through bindings• Invokes services to communicate outside the MVVM
triad
MVVM
• DEMO!!!!• DEMO!!!• DEMO!!• DEMO!
Referências
• John Papa - http://johnpapa.net/• http://www.galasoft.ch/mvvm/getstarted/• http://
msdn.microsoft.com/en-us/magazine/dd419663.aspx
• http://virtualdreams.com.br