启动先开打登录界面,可以取消

退出延时1秒,更好的注销
This commit is contained in:
xu 2020-02-25 04:21:21 +08:00
parent 92044ae56b
commit b728584628
2 changed files with 15 additions and 0 deletions

View File

@ -20,6 +20,7 @@
Width="1920"
Height="1080"
Closing="Window_Closing"
Loaded="Window_Loaded"
>
<c:MetroWindow.Resources>

View File

@ -62,7 +62,12 @@ namespace Plane.FormationCreator
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
bool waitnet = _copterManager.Logined;
_copterManager.NetLogout();
//等待网络退出
if (waitnet)
System.Threading.Thread.Sleep(1000);
/*
MessageBoxResult result = MessageBox.Show("Do you really want to exit?", "", MessageBoxButton.YesNo);
if (result == MessageBoxResult.No)
@ -71,6 +76,15 @@ namespace Plane.FormationCreator
}
*/
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
ServiceLocator.Current.GetInstance<MainViewModel>().LoginCommand.Execute(this);
}
private void btnLogin_Click(object sender, RoutedEventArgs e)
{
var loginWindow = new ConnectWindow