I have two view. I navigate from one to the other and in the other I call RequestClose or use the back keypress. How can I detect in the first ViewModel these events?
Regards, Dan
I have two view. I navigate from one to the other and in the other I call RequestClose or use the back keypress. How can I detect in the first ViewModel these events?
Regards, Dan
By default the MvvmCross framework doesn't tell you about this event.
You'll need to work out some other way of letting the ViewModel know that it needs to do something.
How you do this depends on what the actual event is that you are looking for.
For example:
if the second ViewModel changed some data in an underlying model, then this might be communicated back to the first ViewModel through an event from the data layer.
if the second ViewModel was somehow changing something more transitory (less model like) then you might implement some sort of messaging mechanism (using something like TinyMessenger) to allow ViewModels to communicate.
Can you say any more about what your event is?
Update... as an example, here's the type of thing I might do for facebook - https://github.com/slodge/facebookExample (WP7 only checked in!)