I've got a View containing a TabControl bound to a region "CustomerRegion".
I've got a few View/ViewModels which are marked as [ViewExport(RegionName = "CustomerRegion")].
These items are loaded successfully into the TabControl.
But now I need these TabItems to share some data in this TabControl (can't be global since there might be two or more of these open at one time).
Any ideas how these TabItems can share data without leaving MVVM/MEF?
Prism has the concept of "Region Context" that you might be able to use, depending on your scenario.
Check out the Prism Region documentation and look for the section entitled "Sharing Data Between Multiple Regions" (though this title is a little misleading...).
If you find this doesn't work for you, I would suggest writing a custom inheriting attached property that you can bind to from subviews and modify from the parent view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With