Default Region Behavior Order Problem

Topics: Prism v2 - Silverlight 2
Jun 25, 2009 at 8:49 PM

The UnityBootstrapper ConfigureDefaultRegionBehaviors() method currently adds the AutoPopulateRegionBehavior as the first default behavior in the defaultRegionBehaviorTypesDictionary.

For a Silverlight application using View Discovery, attaching the AutoPopulateRegionBehavior to a region before the other default behaviors can cause the views registered against the region to be created and added to the region before other default behaviors are attached to the region. This can result in an ActiveAware view not being informed it is active since the ActiveAware behaviour hasn’t been attached to the region at the point where the view is created and added to the region.

Changing the code to add the RegionActiveAwareBehavior ahead of the AutoPopulateRegionBehavior fixes the problem described.

I haven’t looked into how the other behaviors interact so I’m interested in the reason for the current order and any known problems that could be created by changing the order.

Jun 25, 2009 at 9:41 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.