Finished Password User Control

Recent and Open now use this control
This commit is contained in:
bg45
2017-10-01 08:48:29 -04:00
committed by BONNEVILLE Geoffroy
parent 324553c58c
commit 6d69dd4d15
9 changed files with 69 additions and 60 deletions

View File

@@ -71,19 +71,12 @@ namespace ModernKeePass.Pages
databaseVm.Name = file.Name;
databaseVm.NotifyPropertyChanged("SelectedVisibility");
databaseVm.NotifyPropertyChanged("Name");
PasswordBox.Focus(FocusState.Programmatic);
}
private void OpenButton_OnClick(object sender, RoutedEventArgs e)
private void PasswordUserControl_PasswordChecked(object sender, Events.DatabaseEventArgs e)
{
var app = (App)Application.Current;
StatusTextBlock.Text = app.Database.Open(PasswordBox.Password);
if (string.IsNullOrEmpty(StatusTextBlock.Text)) _mainFrame.Navigate(typeof(GroupDetailPage), app.Database.RootGroup);
}
private void PasswordBox_KeyDown(object sender, KeyRoutedEventArgs e)
{
if (e.Key == VirtualKey.Enter) OpenButton_OnClick(null, null);
if (e.IsOpen) _mainFrame.Navigate(typeof(GroupDetailPage), app.Database.RootGroup);
}
}
}