Main page now uses Frame to change views when selecting items

Backgrounds unified
Menu items can be disabled thanks to custom ListView control
This commit is contained in:
2017-09-27 18:01:21 +02:00
committed by BONNEVILLE Geoffroy
parent 3a045dbb16
commit caaf34918e
19 changed files with 319 additions and 138 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.ComponentModel;
using Windows.UI.Xaml;
namespace ModernKeePass.ViewModels
{
public class DatabaseVm : INotifyPropertyChanged
{
private string _name;
public Visibility SelectedVisibility { get; set; } = Visibility.Collapsed;
public bool IsOpen { get; set; }
public string Name {
get { return string.IsNullOrEmpty(_name) ? string.Empty : $"Database {_name} selected"; }
set { _name = value; }
}
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -59,8 +59,7 @@ namespace ModernKeePass.ViewModels
Entries.Add(new EntryVm(pwEntry));
NotifyPropertyChanged("Entries");
}
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string propertyName)

View File

@@ -1,24 +0,0 @@
using System.ComponentModel;
using Windows.UI.Xaml;
namespace ModernKeePass.ViewModels
{
public class HomeVm : INotifyPropertyChanged
{
public string Password { get; set; }
public Visibility Visibility { get; set; }
public string ErrorMessage { get; set; }
public bool IsOpen { get; set; }
public HomeVm()
{
Visibility = Visibility.Collapsed;
}
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -0,0 +1,10 @@
using System.Collections.ObjectModel;
using ModernKeePass.Models;
namespace ModernKeePass.ViewModels
{
public class MainVm
{
public ObservableCollection<MainMenuItem> MainMenuItems { get; set; }
}
}