C#C
C#3y ago
Kosta

✅ Mvvm toolkit - messenger not working? Recive messege not invoked

Hey there im trying to recieve a simple messege using messenger
Got this code:
            if (Result == 1) {
                SendToDbSave();
            } 

        }

        [RelayCommand]
        public void SendToDbSave()
        {
            WeakReferenceMessenger.Default.Send(new SaveMessege(Result.ToString()));

        }


 public class MainVM : ObservableRecipient, IRecipient<SaveMessege>
    {
        public void Receive(SaveMessege message)
        {
            Console.WriteLine(message.Value);
        }
    }

So why dont i ever go into the recive messege? i do send the messege, but debug point wont go into recive method
Was this page helpful?