0

I have a question on which, AFAIK information is scarce.

In the StockTrader RI provided by Microsoft there is a definition for a AutoPopulateExportedViewsBehavior, the purpose of which I seem to grasp.

However, this behaviour is declared with an MEF PartCreationPolicy:

[PartCreationPolicy(CreationPolicy.NonShared)]
public class AutoPopulateExportedViewsBehavior : RegionBehavior, IPartImportsSatisfiedNotification

Could anybody explain why this Part Creation policy cannot be "Shared"? Why would individual instances of this policy need to be provided upon each call for this behaviour?

Am I correct in assuming this is because the behaviour gets attached to a specific region and thus you inherently need an instance?

Kris
  • 2,100
  • 5
  • 31
  • 50

1 Answers1

0

Your assumption is correct. Each RegionBehavior instance is bound to a single region, so we do need a new RegionBehavior instance when a new Region is encountered.

Bas
  • 26,772
  • 8
  • 53
  • 86
  • Thanks for the confirmation! Are you by any chance aware of some more in depth description of RegionBehavior? So far, Google has only provided links to very specific problems that are fixed using dedicated RegionBehaviors, never a more general analysis ... – Kris Jul 29 '14 at 12:36