In the constructor of your MainPage (or whatever):
Messenger.Default.Register<string>(this, MessageReceived);
The MessageReceived method (also in MainPage):
private void MessageReceived(string message)
{
if (message == "SomeTabWasClosed")
{
//Do the necessary clean-up
}
}
{
if (message == "SomeTabWasClosed")
{
//Do the necessary clean-up
}
}
Then when you need to send the message (maybe in your tab Views or their ViewModels):
Messenger.Default.Send("SomeTabWasClosed");
'.NET > MVVM Light' 카테고리의 다른 글
[MVVM-Light]Implementing Progress bar using WPF with MVVM pattern(using BackgroundWorker) (0) | 2013.07.10 |
---|---|
[MVVM-Light]ViewModel 간 values 전달 (0) | 2013.07.10 |