EventAggregator equivalent in Noesis/c++
Is there an equivalent in Noesis or c++ for the Prism EventAggregator (https://prismlibrary.com/docs/event-aggregator.html) or similar pub-sub communication system? I'm trying to create a communication system between loosely coupled components like ViewModels.
Re: EventAggregator equivalent in Noesis/c++
There is nothing like that implemented by default in Noesis. You need to do it yourself.
Re: EventAggregator equivalent in Noesis/c++
Is there a sample you can post of communication between ViewModels in Noesis C++? I feel like having ViewModels directly reference each other is messy and might violate the principles of MVVM. But I'm coming from the .NET world, so this might be completely different.There is nothing like that implemented by default in Noesis. You need to do it yourself.
-
-
sfernandez
Site Admin
- Posts: 3222
- Joined:
Re: EventAggregator equivalent in Noesis/c++
You can implement the EventAggregator idea or very similar in C++.
For example, all of your viewmodels can inherit from a ViewModelBase that receives the application event queue in its constructor, so they can subscribe to events, or publish them.
When a viewmodel needs to create other viewmodels it can pass along the application event queue to those new viewmodels.
Did you find any scenario in that EventAggregator pattern that cannot be applied to C++?
For example, all of your viewmodels can inherit from a ViewModelBase that receives the application event queue in its constructor, so they can subscribe to events, or publish them.
When a viewmodel needs to create other viewmodels it can pass along the application event queue to those new viewmodels.
Did you find any scenario in that EventAggregator pattern that cannot be applied to C++?
Who is online
Users browsing this forum: Ahrefs [Bot] and 0 guests