Solved

What is the best way to communicate events between ViewModels in a .Net WPF MVVM application?

Posted on 2017-02-17
1
28 Views
Last Modified: 2017-02-23
Hi:

I am creating  a .Net WPF application that is a dashboard.
I am implementing the dashboard using the MVVM framework.
I need the ability to communicate events between different View Models on the dashboard.
This to me feels like a pub/sub events model.

What is the best way to implement a solution which fits well with the MVVM FrameWork?
I started to look at Prism, but am wondering if that is a little heavy handed for my needs.

Can someone recommend a best practices approach and point me to some simple
examples of implementation?

Thanks,
JohnB
0
Comment
Question by:jxbma
1 Comment
 
LVL 2

Accepted Solution

by:
Steve Synan earned 500 total points
ID: 42018632
For simple applications I like using MVVM Light Toolkit

It contains a Messenger object which really simplifies passing messages between decoupled view models.

Here's a link to the devs blog about the newer Messenger version, which might be a good place to start (plenty of examples can be found by doing a google search for 'MVVM Light Toolkit Messenger' as well).
1

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question