Better Entry URL go to button

Migrated code from code behind pages to view models
Auto select Recents if there are any recent items
WIP auto focus on password box when opening database
This commit is contained in:
2017-10-09 18:40:02 +02:00
committed by BONNEVILLE Geoffroy
parent f2794f8055
commit 98ecb0b8a1
15 changed files with 134 additions and 71 deletions

View File

@@ -1,4 +1,6 @@
using System.Collections.ObjectModel;
using System.Linq;
using Windows.Storage.AccessCache;
using ModernKeePass.Common;
namespace ModernKeePass.ViewModels
@@ -8,6 +10,16 @@ namespace ModernKeePass.ViewModels
private RecentItemVm _selectedItem;
private ObservableCollection<RecentItemVm> _recentItems;
public RecentVm()
{
var mru = StorageApplicationPermissions.MostRecentlyUsedList;
RecentItems = new ObservableCollection<RecentItemVm>(
from entry in mru.Entries
select new RecentItemVm { Name = entry.Metadata, Token = entry.Token });
if (RecentItems.Count > 0)
SelectedItem = RecentItems[0];
}
public ObservableCollection<RecentItemVm> RecentItems
{
get { return _recentItems; }