protected virtual void OnMsgClose(MsgClose msg) { // Close the window only if the message comes from the DataContext of this window if (msg.SenderViewModel == this.DataContext) { this.Close(); } }
void MsgClose_Handler(MsgClose msg) { this.OnMsgClose(msg); }