Added ViewModel property in code behind of all pages

Workaround a bug in Entry password reveal when set for the first time
This commit is contained in:
2017-10-12 18:37:49 +02:00
committed by BONNEVILLE Geoffroy
parent 0ded991673
commit 9f94dd55c2
10 changed files with 35 additions and 41 deletions

View File

@@ -17,6 +17,8 @@ namespace ModernKeePass.Pages
{
private Frame _mainFrame;
public OpenVm Model => (OpenVm)DataContext;
public OpenDatabasePage()
{
InitializeComponent();
@@ -38,9 +40,8 @@ namespace ModernKeePass.Pages
};
picker.FileTypeFilter.Add(".kdbx");
var viewModel = DataContext as OpenVm;
// Application now has read/write access to the picked file
viewModel?.OpenFile(await picker.PickSingleFileAsync());
Model.OpenFile(await picker.PickSingleFileAsync());
}
private void PasswordUserControl_PasswordChecked(object sender, PasswordEventArgs e)