MVVM – Model View ViewModel is the new design pattern originated from Microsoft, introduced by Martin Flower in 2004 and widely used after a publication of Josh Smith on MSDN magazine in 2009. MVVM is targeted at modern user interface development platforms such as WPF and Silverlight which are completely differently designed to traditional developer. Although MVVM bases on MVC – Model View Controller, the ViewModel is more better because it provides an easier way to expose and cosume data objects from the Model and therefore can handle the display logic of View. Despite of the great data binding functions of WPF, in MVVM we do not have to write any code in the View layer anymore. The View and Model layer are completely seperated which means the designers can use native WPF markup language XAML and create bindings to the ViewModel ,which is written by application developers, without writing any code behind the View. The designers can then focus on their designs rather than developing the business logic behind and therefore the software development can be better controlled,easier for bugfixing and transparenter. That’s short description about MVVM and its advantages. I think MVVM is not the hot topic anymore so if you want, you can find a lot of interesting articles on internet. In this blog post, I just want to try the MVVM Light Toolkit to generate automatically a MVVM application for me when I create a new application because until now I must create the pattern myself manually.
Continue reading C# – MVVM and Entity Framework