Major changes in MainPage: now is layout dependant (with a base, to prepare for Settings)

Main sub pages also changed to better work with Main (but needs improvement)
Added a Settings Page stub
This commit is contained in:
2017-10-26 18:57:39 +02:00
committed by BONNEVILLE Geoffroy
parent 1b439a4960
commit d10f617910
26 changed files with 833 additions and 67 deletions

View File

@@ -5,7 +5,7 @@ using ModernKeePass.Interfaces;
namespace ModernKeePass.ViewModels
{
public class MainMenuItemVm: NotifyPropertyChangedBase, IIsEnabled
public class MainMenuItemVm: NotifyPropertyChangedBase, IIsEnabled, ISelectableModel
{
private bool _isSelected;

View File

@@ -5,11 +5,13 @@ using Windows.Storage.AccessCache;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using ModernKeePass.Common;
using ModernKeePass.Interfaces;
using ModernKeePass.Pages;
using ModernKeePass.Pages.BasePages;
namespace ModernKeePass.ViewModels
{
public class MainVm : NotifyPropertyChangedBase
public class MainVm : NotifyPropertyChangedBase, IHasSelectableObject
{
private IOrderedEnumerable<IGrouping<int, MainMenuItemVm>> _mainMenuItems;
private MainMenuItemVm _selectedItem;
@@ -22,7 +24,7 @@ namespace ModernKeePass.ViewModels
set { SetProperty(ref _mainMenuItems, value); }
}
public MainMenuItemVm SelectedItem
public ISelectableModel SelectedItem
{
get { return _selectedItem; }
set
@@ -33,7 +35,7 @@ namespace ModernKeePass.ViewModels
_selectedItem.IsSelected = false;
}
SetProperty(ref _selectedItem, value);
SetProperty(ref _selectedItem, (MainMenuItemVm)value);
if (_selectedItem != null)
{