KFDtool/sw/control/KFDtool.Gui/Dialog/ContainerEnterPassword.xaml.cs

39 lines
1005 B
C#
Raw Normal View History

2020-08-01 08:12:20 -06:00
using System.Windows;
namespace KFDtool.Gui.Dialog
{
/// <summary>
/// Interaction logic for ContainerEnterPassword.xaml
/// </summary>
public partial class ContainerEnterPassword : Window
{
public bool PasswordSet { get; set; }
public string PasswordText { get; set; }
public ContainerEnterPassword()
{
InitializeComponent();
PasswordSet = false;
PasswordText = string.Empty;
txtPassword.Focus(); // focus first password field on load
}
private void Submit_Click(object sender, RoutedEventArgs e)
{
if (txtPassword.Password.Length == 0)
{
MessageBox.Show("Password is required", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
PasswordSet = true;
PasswordText = txtPassword.Password;
Close();
}
}
}