/// <summary> /// 关闭View【通过消息关闭View】 /// </summary> protected void CloseView() { CloseViewOfNewWindowArgs args = new CloseViewOfNewWindowArgs(ViewModelID); //发送关闭View消息 MsgAggregation.Instance.SendNavigationMsgForCloseWindow(args); }
/// <summary> /// 关闭窗口 /// </summary> /// <param name="args">参数</param> public void SendNavigationMsgForCloseWindow(CloseViewOfNewWindowArgs args) { GalaSoft.MvvmLight.Threading.DispatcherHelper.CheckBeginInvokeOnUI(() => { GalaSoft.MvvmLight.Messaging.Messenger.Default.Send <CloseViewOfNewWindowArgs>(args, SystemKeys.CloseWindow); }); }
//通过消息关闭打开的窗体 private void CloseWindowCallback(CloseViewOfNewWindowArgs args) { WindowHelper.Instance.RemoveOpenedWindowAndCleanUp(args.CloseViewModelID, true); }