mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Code refactor and simplfication
ModernKeePassLib assembly info updated and version fixed
This commit is contained in:
34
ModernKeePass/Controls/OpenDatabaseUserControl.xaml.cs
Normal file
34
ModernKeePass/Controls/OpenDatabaseUserControl.xaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Input;
|
||||
|
||||
// Pour en savoir plus sur le modèle d'élément Contrôle utilisateur, consultez la page http://go.microsoft.com/fwlink/?LinkId=234236
|
||||
|
||||
namespace ModernKeePass.Controls
|
||||
{
|
||||
public sealed partial class OpenDatabaseUserControl : UserControl
|
||||
{
|
||||
public OpenDatabaseUserControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
PasswordBox.Focus(FocusState.Programmatic);
|
||||
}
|
||||
|
||||
public delegate void PasswordCheckedEventHandler(object sender, EventArgs e);
|
||||
public event PasswordCheckedEventHandler ValidationChecked;
|
||||
|
||||
private void OpenButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var app = (App)Application.Current;
|
||||
StatusTextBlock.Text = app.Database.Open(PasswordBox.Password);
|
||||
ValidationChecked?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
private void PasswordBox_KeyDown(object sender, KeyRoutedEventArgs e)
|
||||
{
|
||||
if (e.Key == VirtualKey.Enter) OpenButton_OnClick(null, null);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user