mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Added unit tests (all passing unfortunately)
UI improvements Write mode still doesn't work
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user