Search This Blog

Tuesday, August 23, 2011

PRISM passing data in RegionContext

Define region in the following way - with regionName and region context defined


<ItemsControl MinHeight="400" regions:RegionManager.RegionName="RCP.WorkerShowPersonalDataRegion" regions:RegionManager.RegionContext="{Binding Path=CurrentWorker, Mode=TwoWay}" >
    <!-- PRISM registers various types of configuration views here -->


Receive Context in ViewModel like this:
this.RegionContext = regionManager.Regions[RegionNames.WorkerShowPersonalDataRegion].Context;

This can be done in Constructor or e.g. OnNavigatedTo method from PRISM INavigationAware.

1 comment:

If you like this post, please leave a comment :)