N=9 - Get the Message (N+1 Days of MvvmCross)

Stuart Lodge · 6K views · 2013 · 18:46

Open on YouTube

Software architecture & designSoftware practice, open source & careerstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when explaining how to use the MvvmCross Messenger plugin for decoupled communication between view models and services.

Recommended by 1 people across 1 different months, 2013 to 2017.

What it is

An 18-minute episode of Stuart Lodge's 'N+1 Days of MvvmCross' tutorial series, in which he adds the Messenger plugin to an MvvmCross app. It builds on the previous location-service episode and shows publish/subscribe messaging between components.

What people said

Recommends Talbott Crowell · 2013-06 · Stack Overflow · on “IMvxServiceProducer and IMvxServiceConsumer missing from latest NuGet”

Awesome. I found the "N=9 Get the Message" video perfect for solving the problem of sharing a service (like the location service) across devices using the pub/sub model [this video]

Cites stuartmclark · 2015-11 · Stack Overflow · on “Can MvvmCross Messenger Plugin be used across multiple applications?”

We are getting in the design phase of using MvvmCross for our application platform and we are trying to figure out if we can use the MvvmCross Plugin to broadcast messages between multiple MvvmCross applications? These applications will be running on the same machine in parallel, and on an internal network. I did consider using RabbitMQ for this but found out that you cannot add RabbitMQ to a Portable Class Library Project. So that's out of the question. I watched this video : [this video] and the speaker says the Messenger can be used within an application, but I would like to know if it can enable communication between different applications. Any help would be greatly appreciated.

Cites WickedW · 2017-05 · Stack Overflow · on “In MVVMCross, is it possible to close a viewmodel and pass values back to the previous viewmodel in the navigation stack?”

Installing & using the MvxMessenger plugin is a great way to decouple view model communication in MvvmCross - In your case, you could set up a new message - public class ValuesChangedMessage : MvxMessage { public ValuesChangedMessage(object sender, int valuea, string valueb) : base(sender) { Valuea = valuea; Valueb = valueb; } public int Valuea { get; private set; } public string Valueb { get; private set; } } In ViewModel_Values, you would act on / publish your UX changes with - _mvxMessenger.Publish<ValuesChangedMessage>(new ValuesChangedMessage(this, 1, "boo!")); And in ViewModel_A, ViewModel_B you would subscribe and act on them (as your ViewModel A / B would be still in the navigation s