Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Manage 2 regions containing 2 UserControls of same type

$
0
0
Hi,

Based on my understanding of your application, a possible solution to your problem could be to react to the CollectionChanged event from the SourceRegion and DestinationRegion regions. Therefore, you will need to subscribe to this event in your ParentRegion view model and then change the SourceText or DestinationText accordingly. The following is an example on how to subscribe to them:
//SourceRegionViews_CollectionChangedHandler will modify SourceTextthis.regionManager.Regions["SourceRegion"].Views.CollectionChanged += SourceRegionViews_CollectionChangedHandler;

//DestinationRegionViews_CollectionChangedHandler will modify DestinationTextthis.regionManager.Regions["DestinationRegion"].Views.CollectionChanged += DestinationRegionViews_CollectionChangedHandler;
This way, your subscription handlers will be invoked every time a View is added in the corresponding region; there you will receive the injected View and you can execute the logic you are trying to achieve.

If this doesn't help or we misunderstood your problem, it would be helpful if you can provide us more details about your ParentRegion.

Regards,

Federico Martinez
http://blogs.southworks.net/fmartinez

Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>