How to send a message to one kind of many

I have an application that presents many pairs of view-viewModel based on the same view and viewModel. (i.e. there are many representations of the form -> viewModel)

I can use Messenger to send / register messages from viewModel for viewing, and when I send a message from a view, it is processed by all the views (they are all registered for the message).

How can I use Messenger to send a message from viewModel to the specific view that created the viewModel? (All views are registered for the message, but I want one of the views to process the message)

+3
source share
1 answer

.

, ViewModel ABCView, Messenging .

Ex, , :

Messenger.Defalut.Send<bool>(true,"ForAbcView");

ABCView :

Messenger.Default.Register<bool>(this,"ForAbcView",(b)=>{ //Some Code });

Token Messenger Sender , . , .

+1

All Articles