Send a empty Message or Notification with MVVM toolkit light

后端 未结 4 851
故里飘歌
故里飘歌 2021-01-22 00:14

I\'m using the MVVM Light Toolkit. I could not find any Ctor of Messenger or Notification class to send a empty message.

ViewModel1:

 private int _select         


        
4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-22 01:04

    Unless I'm misunderstanding something, couldn't you accomplish this by creating and sending a custom "signal message" type via the Messenger?

    public class WeeklyRotationSignal {}
    
    Messenger.Default.Send(new WeeklyRotationSignal());
    

    Then register to that in another view model:

    Messenger.Default.Register(this, msg => doWork);
    

提交回复
热议问题