Prism V2: The 6th drop is out (a.k.a. Composite Application Guidance for WPF and Silverlight)
November 24th, 2008
The 6th drop for this project is already out of the team room and into Codeplex, as it has been every 2 weeks since 2*(6-1)=10 weeks back from today.
You can see the complete list of latest changes in Erwin’s post.
The biggest changes for this drop, although not very noticeable from the outside if you’re just using the default way that Regions work without the need to extend them, are:
- Added RegionContext
This is to provide a way to pass some context to the Views that are placed inside a particular instance of a region. You were usually able to workaround the need for this context by using EventAggregator or scoped DI containers, but luckily this will be easier to achieve for those same scenarios and for more complex ones (for example when using scoped region managers and having several instances of the same region).
- Formalized infrastructure for extending the behavior of Regions
In Prism 1.0 there were already some ad-hoc behavior classes for extending the functionality of the regions (for example the CollectionActiveAwareBehavior or SelectorRegionSyncBehavior).
In Prism V2, we also had to rethink how the RegionManager attached properties would work in the Silverlight world, as it is different from WPF (Silverlight lacks property value inheritance). We also added features like the new Pull-based composition scenario, or the RegionContext attached property.
We started adding separate behavioral objects for these new features, which were very flexible, but very hard to understand, debug, and to know which objects were currently modifying the behavior of a particular region instance.
This created the need for an infrastructure for all of these formerly independent behavior objects, that would make the library easier to understand, extend and maintain.
The IRegion interface now has a collection of IRegionBehavior objects, so you can always know which objects are extending the functionality of a particular Region instance, and it can also couple the lifetime for these behaviors and regions, in order to prevent memory leaks when developing new behaviors.
Picture taken from Erwin’s blog post. Read the full post hereICommand for Silverlight 2.0 RTW Updated Sample
November 21st, 2008
Some time ago, we blogged about how to implement the ICommand feature that is available in WPF but missing in Silverlight.
The sample included in that post was using Silverlight 2 beta 2, so I updated the code now to target Silverlight 2 RTW. The main difference is that the old code included the ICommand interface which is now available directly in the Silverlight 2 bits (although there is no class implementing it, nor the input controls know how to bind to it).
Read the full blog post here:
Downlad the updated sample code here: