using HMI.Core.Entity;
|
using HMI.UI.Util;
|
using Panuon.WPF.UI;
|
using System.ComponentModel;
|
|
namespace HMI.Base
|
{
|
/// <summary>
|
/// RequirePasswordWindow.xaml 的交互逻辑
|
/// </summary>
|
public partial class RequirePasswordWindow : WindowX
|
{
|
public RequirePasswordWindow()
|
{
|
this.DataContext = this;
|
InitializeComponent();
|
}
|
|
private string username;
|
public string Username
|
{
|
get => username;
|
set
|
{
|
Set(ref username, value);
|
}
|
}
|
|
protected override void OnClosing(CancelEventArgs e)
|
{
|
//Press Continue Button
|
if (DialogResult == true)
|
{
|
if (!string.Equals(PwdPassword.Password, UserInfo.User.Password))
|
{
|
ToastHelper.Error(this, "密码错误");
|
e.Cancel = true;
|
}
|
}
|
base.OnClosing(e);
|
}
|
|
private void WindowX_Loaded(object sender, System.Windows.RoutedEventArgs e)
|
{
|
Username = UserInfo.User.Username;
|
PwdPassword.Password = string.Empty;
|
}
|
}
|
}
|