Are you adding the RegionBehavior manually or do you register it in the bootstrapper in ConfigureDefaultRegionBehaviors
?
It seems that if you add a behavior manually like this:
IRegion region = regionManager.Regions["MyRegion"];
region.Behaviors.Add("MyBehaviorKey", new MyBehavior());
the IHostAwareRegionBehavior
interface has no effect. If you look at the PRISM source code in RegionBehaviorCollection.cs (Prism.Dektop.Regions) you'll clearly see that the Add method does not do anything related to the IHostAwareRegionBehavior
interface.
However in RegionAdapterBase.cs, the interface is checked for in AttachDefaultBehaviors
.
I ended up registering my RegionBehavior in the bootstrapper and checking the region name to see if there is work to be performed. Not very clean, but it works.