using CyberX8_MainPages.Unity; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace CyberX8_MainPages.Views { /// /// LogoutView.xaml 的交互逻辑 /// public partial class LogoutView : Window { public LogoutView() { InitializeComponent(); userTextBlock.Text = GlobalUser.Instance.User.Name; passwordTextBlock.Text = "******"; roleTextBlock.Text = GlobalUser.Instance.User.Role.ToString(); } private void Close_Click(object sender, RoutedEventArgs e) { this.Close(); } private void Login_Click(object sender, RoutedEventArgs e) { Logout(); } private void PassWordTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { Logout(); } } private void Logout() { GlobalLogin.Instance.ReLogin = true; } private void Window_Closed(object sender, EventArgs e) { this.Closed -= Window_Closed; this.logButton.Click -= Login_Click; this.closeButton.Click -= Close_Click; } } }