Hello,
I was using MVP when I was working with winform. but I moved to MVVM when i started playing with WPF or Silverlight.
The only thing that I noticed is that we don't need to sync with the data between View and ViewModel in MVVM pattern because of powerful binding.
My question are ~
1) Binding (that helps us not to sync View and ViewModel manually) is the only advantage of using MVVM.
2) Is there any other advantage MVVM over MVP? what are the differences?
3) The code below is MVVP pattern or MVVM or both?
interface IView{
void ShowMessage(string message);
}
class View : IView {
public void ShowMessage(string message){
MessageBox.Show(this, message);
}
}
class ViewModel{
private IView view;
public ViewModel(IVew view){
this.view = view;
}
........
view.ShowMessage("This is a msg");
}
Thanks.