I have a WPF Prism Application with e.g. several Customers i want to edit. So i have 5 Tabs for 5 customers for example.
Each customer has 5 subtabs, like setting, details etc.
When I load a Customer or update it I want a prism event published to every subtab gets updated.
The only problem is: the other subtabs will get updated with the same customer aswell… which is not the plan 😀
So is it possible that only the active tab and those viewmodels can subscribe to the event, or something like this?
Thanks for help!
I did something like this a while back
I can’t remember exact details, however the tabs subscribed to events with a
LoadConsumerMessage, and the message had two extra properties in addition to the usual message properties: aIdfield and anIsHandledfield.If I wanted a specific tab to load the consumer, I’d populate the
Idwith the id of the tab I wanted. For example, to load a Customer in the current tab I’d useThen in the subscribers that process the event, I’d ignore the event if it didn’t match
If I wanted only the first available tab to handle the event, I’d set the
IsHandledproperty in the first subscriber, and ignore the event if it was ever true