private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (tbContent.HasItems) { if (!MessageWin.Confirm("确定退出?") ?? true) { e.Cancel = true; return; } CloseAll(); } MainWindowVM.SaveSetting(); }
/// <summary> /// 退出登录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LogoutMenuItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (MessageWin.Confirm("确定要退出登录?") != true) { return; } //string output = HttpHelper.GetUrl("/Auth/LoginOut", null, UserInfo.Token); //this.CloseWithoutAsk = true; //var frmLogin = new Login(UserInfo.Account, string.Empty); //frmLogin.Show(); //UserInfo.UserID = 0; //UserInfo.PassWord = ""; //UserInfo.UserMenu = null; //UserInfo.Account = UserInfo.UserName = UserInfo.DepartmentName = UserInfo.Token = string.Empty; this.Close(); }
public static bool?MessageConfirm(string msg, string title = "确认") { return(DispatcherInvoke(() => { return MessageWin.Confirm(msg, title); })); }