views:

251

answers:

1

Hello, i have a class wich send uri to change page after login, but how can i make to send my new uri and my object "user" to the new page ??

public static class StatusUpdatePage
    {
        public static void Send(Uri uri)
        {
            Messenger.Default.Send<Uri>(uri);
        }

        public static void Register(object recipient, Action<Uri> action)
        {
            Messenger.Default.Register<Uri>(recipient, action);
        }
    }

thx

A: 

All you have to do is register the messenger on ViewModel A with the action you want to be thrown when a message is received: Messenger.Default.Register(this, action); // this refers to the object that will be receiving the message (in your case your ViewModel)

And From Wherever you want to send the message you do what you did to send the message: Messenger.Default.Send(uri);

Hope this helped.

Rodrigue H
I have created a complex class with two properties, Uri and User and i make public static void Send(MyComplexClass uriAndUser)
chris81