mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Lots of code refactoring to use XAML behaviors instead of code-behind
New Save button in the AppBar EntryPage now uses the same AppBar as GroupPage (but not shared...) Some new Symbol mappings
This commit is contained in:
@@ -4,6 +4,8 @@ namespace ModernKeePass.ViewModels
|
||||
{
|
||||
public class AboutVm
|
||||
{
|
||||
public string Name { get; } = Package.Current.DisplayName;
|
||||
|
||||
public string Version
|
||||
{
|
||||
get
|
||||
@@ -11,7 +13,7 @@ namespace ModernKeePass.ViewModels
|
||||
var package = Package.Current;
|
||||
var version = package.Id.Version;
|
||||
|
||||
return $"{package.DisplayName} version {version.Major}.{version.Minor}";
|
||||
return $"{version.Major}.{version.Minor}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -195,5 +195,10 @@ namespace ModernKeePass.ViewModels
|
||||
ParentGroup.Entries.Add(this);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
var app = (App)Application.Current;
|
||||
app.Database.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -51,13 +51,7 @@ namespace ModernKeePass.ViewModels
|
||||
return result == Symbol.More ? Symbol.Folder : result;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLeftPaneOpen
|
||||
{
|
||||
get { return _isLeftPaneOpen; }
|
||||
set { SetProperty(ref _isLeftPaneOpen, value); }
|
||||
}
|
||||
|
||||
|
||||
public bool IsEditMode
|
||||
{
|
||||
get { return _isEditMode; }
|
||||
@@ -113,5 +107,11 @@ namespace ModernKeePass.ViewModels
|
||||
{
|
||||
ParentGroup.Groups.Add(this);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
var app = (App)Application.Current;
|
||||
app.Database.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.Storage.AccessCache;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
@@ -13,6 +14,8 @@ namespace ModernKeePass.ViewModels
|
||||
private IOrderedEnumerable<IGrouping<int, MainMenuItemVm>> _mainMenuItems;
|
||||
private MainMenuItemVm _selectedItem;
|
||||
|
||||
public string Name { get; } = Package.Current.DisplayName;
|
||||
|
||||
public IOrderedEnumerable<IGrouping<int, MainMenuItemVm>> MainMenuItems
|
||||
{
|
||||
get { return _mainMenuItems; }
|
||||
|
@@ -36,6 +36,7 @@ namespace ModernKeePass.ViewModels
|
||||
|
||||
public RecentVm()
|
||||
{
|
||||
// TODO: opening the files actually changes the MRU order
|
||||
var mru = StorageApplicationPermissions.MostRecentlyUsedList;
|
||||
foreach (var entry in mru.Entries)
|
||||
{
|
||||
|
Reference in New Issue
Block a user