What I'm trying to do is pass a variable from one module to another module. I know I could use the EventAggregator, but it seems a bit messy for this situation:
I have a tree in one module (moduleTree) and a RibbonBar in another module (moduleRibbonBar). When I click on the node of a tree it gets the ID of that node. In the RibbonBarModule When I click on a button "LoadMappings", it should get
the Mappings for that ID and load them.
So here are the steps that I want to happen:
1) Click on Node in moduleTree to get ID
2) Click on button in moduleRibbonBar to load the mappings
3) Get the ID of the selected node from moduleTree from moduleRibbonBar
4) Load up the settings.
The problem with using the Event Aggregator is that I would need 2 event calls:
- "LoadMappings" Button is clicked in moduleRibbonBar, throws an event
- ModuleTree catches the event and gets the ID of the selected node, throws an event
- Module RibbonBar catches the event that Module Tree throws, and now it can do its thing.
So is this the way I'm supposed to do it? I've tried to mess around with registering Types:
But I doubt that is the way to go. Can anyone help me out on this one?