WIP New database (and open and recent...)

This commit is contained in:
2017-10-11 18:43:27 +02:00
committed by BONNEVILLE Geoffroy
parent 97b1475100
commit 2f1355104e
14 changed files with 185 additions and 25 deletions

View File

@@ -1,25 +1,25 @@
using System.ComponentModel;
using Windows.Storage;
using Windows.Storage.AccessCache;
using Windows.UI.Xaml;
using ModernKeePass.Common;
namespace ModernKeePass.ViewModels
{
public class OpenVm: INotifyPropertyChanged
{
public StorageFile File { get; set; }
public bool ShowPasswordBox
{
get { return File != null; }
get { return ((App)Application.Current).Database.Status == DatabaseHelper.DatabaseStatus.Opening; }
}
public string Name
{
get { return File?.Name; }
get { return ((App)Application.Current).Database.Name; }
}
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
@@ -27,7 +27,8 @@ namespace ModernKeePass.ViewModels
public void OpenFile(StorageFile file)
{
File = file;
var database = ((App)Application.Current).Database;
database.DatabaseFile = file;
NotifyPropertyChanged("Name");
NotifyPropertyChanged("ShowPasswordBox");
AddToRecentList(file);