ページ

Wednesday, August 18, 2010

MVVM Pattern for Silverlight 4

I tried creating a simple silverlight application under some of MVVM pattern rules like followings.

・Views can do "CRUD" data only by "Data Binding" from ViewModels. ( CRUD : Create, Read, Update, Delete )
・Any events will be executed on ViewModels by "ICommand" from Views or some Behaviors on Views.
    (which means there is no code behind on the view.)

⇒ "loose coupling" between a view and a viewmodel ( ViewとViewModelの疎結合 )


MVVM Pattern for Silverlight 4  Demo
http://demo.gehintleman.com/MVVMPattern.html

・There are 4 Views (including MainView), and all the Views do not have any code behinds.
・Views and ViewModels are managed through ExportAttribute/ImportAttribute.
・Using resource files(*.resx) for the localization.


MVVM Pattern could clearly devide web application development into coding by programmers and designing by designers.

* Differently from WPF, Silverlight cannot assign(bind) ViewModels to Views in Application.Resources in APP.XAML.
   But, Managed Extensibility Framework ( a.k.a. MEF ) is so great that we can easily manage ViewModels and Views.

No comments:

Post a Comment