My Summary of Composite WPF&Silverlight, a.k.a Prism
After finding Quite a number of screen cast, It's quite hard to understand at first. the starting Comprehensive Video that i found are the Videos from the silverlightBayLabs,it's very nice and simple Anyway for Our application which use many controls in 1 xaml and have many interaction with each other it is a Very nice If Our Silverlight App can be Tested And Become Modular
This can be done by composite Application Block. Similar To other Type of application ,Composite Block for web it's WCSF and SCSF for the Windows Form.
What it does is almost the same. Shell is the end point. shell does not know anything. It only job is to Register Which Modules for this application We than separate our concern into separate module , seperate project. On Module which inherit from IModule , which has 1 method ->Initialize We register our Type And View and region .As for other Type of Work/Behaviour we add on this Module project. After A couple of this screen cast i finally grasp the idea. Especially MVVM
Shell.Xaml is our master page we register our View Using RegionManager. We seperate our View From it's Logic and Event. Model - ViewModel. ViewModel will consist of our logic , it's an island of it self. he does not know about the view at all. We can seperate /loosely coupled this Class Using depedency Injection. You just called the IUnityContainer. UnityContainer is like a Holder for your type. and it can initiate what Type you need.
EventAggregator work for use to publish event to subscriber. it acts like a mediator for you.So your Cross module can just register to it.
DelegateCommand is the One who can pass the Click Event from the Xaml to View Model. default is click only but can be extended.
To Make a Silverlight app Test project just reference 2 dll: Microsoft.Silverlight.testing ,Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight
To Make Blend Work And can Search for our Behaviour reference 1 dll on the project: Microsoft.Expression.Interactiviy
The Composite Block use weak reference on binding. we have to make our eventhandler method Public so that can be Unsubscribe from the event All the bold ones are the helper for us to use to implement MVVM/MVP
07/02/2010
There are discussion over MVVM , that it is lack of template , OverHead when used on Large application.it lack of pattern like wheter we put this on view model or the behind code view it self
http://en.wikipedia.org/wiki/MVVM