mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
WIP New database (and open and recent...)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user