Integrate Pub / Sub system for view models communication #28
Labels
enhancement
New feature or request
feature request
Means some additional functionality is asked
layer/application
Means some changes in the Application layer
layer/infrastructure
Means some changes in the Infrastructure layer
CommunityToolkit.Mvvm.Messaging provides
IMessenger
interface, that allows us to set up Pub / Sub system for flexible ViewModels communication.How it can be useful?
We have a
ProductsView
withProductsViewModel
, which has a list of products.And a
ProductView
withProductViewModel
, where we can see some detail information, modify it, delete current product or to add a new one.After we added, edited or deleted a product - we can just send a message, what we've modified.
And the main
ProductsViewModel
will handle it and will update its collection.So, we won't need to load all the products from the database after every modification - we just will need to update im-memoty Observable collection.
The text was updated successfully, but these errors were encountered: