MVVM窗体show的弹窗事件

RestMatCutWin restMatCutWindow;//定义一个窗体的全局变量

  private void RestMatCutWinExecute()
  {

   if (restMatCutWindow==null)
            {
                restMatCutWindow = new RestMatCutWin();
                restMatCutWindow.Owner = Application.Current.MainWindow;
                restMatCutWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                restMatCutWindow.Closed += new EventHandler(restMatCutExecuteClose);
               
                restMatCutWindow.Show();
            }

  }
  private void restMatCutExecuteClose(object sender, EventArgs e) { restMatCutWindow = null; }

  

public ICommand RestMatCutWin { get { return new QueryCommand(RestMatCutWinExecute, IaBool); } }

  

posted @ 2019-08-19 11:20  可乐_加冰  阅读(513)  评论(1编辑  收藏  举报