Added unit tests (all passing unfortunately)

UI improvements
Write mode still doesn't work
This commit is contained in:
2017-09-25 18:34:27 +02:00
parent 34996da19d
commit 22ea657885
72 changed files with 2563 additions and 63 deletions

View File

@@ -1,7 +1,7 @@
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using ModernKeePass.Pages;
using ModernKeePass.ViewModels;
@@ -48,7 +48,8 @@ namespace ModernKeePass
var homeVm = DataContext as HomeVm;
var app = ((App)Application.Current);
homeVm.ErrorMessage = app.Database.Open(homeVm.Password);
if (!app.Database.IsOpen) homeVm.NotifyPropertyChanged("ErrorMessage");
if (!string.IsNullOrEmpty(homeVm.ErrorMessage)) homeVm.NotifyPropertyChanged("ErrorMessage");
else Frame.Navigate(typeof(GroupDetailPage), app.Database.RootGroup);
}
@@ -71,5 +72,15 @@ namespace ModernKeePass
SelectGrid.Visibility = Visibility.Collapsed;
}
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
var app = (App)Application.Current;
if (app.Database == null) return;
var homeVm = DataContext as HomeVm;
homeVm.IsOpen = app.Database.IsOpen;
homeVm.NotifyPropertyChanged("IsOpen");
}
}
}