Send a empty Message or Notification with MVVM toolkit light

后端 未结 4 847
故里飘歌
故里飘歌 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条回答
  •  鱼传尺愫
    2021-01-22 00:57

    I don't think that it is possible and frankly I don't see the point of having that kind of message. You could just as well send a string "SelectedWeeklyRotation". It seems strange to have an empty message that has some kind of meaning as you increase the number of broadcast messages - and receivers in your application.

    In the version of MVVM Light that I'm using it is not even possible to send an empty message.

    However I did see a method in the ViewModelBase that is :

    // Update bindings and broadcast change using GalaSoft.MvvmLight.Messenging
    RaisePropertyChanged(MyPropertyPropertyName, oldValue, value, true);
    

    This might be of interest for you.

提交回复
热议问题