mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Re-enabled write mode in KeePassLib
Set database as part of App (so, Singleton) Changed main page view model WIP and testing saving mechanism
This commit is contained in:
@@ -7,6 +7,8 @@ namespace ModernKeePass.ViewModels
|
||||
{
|
||||
public class GroupVm : INotifyPropertyChanged
|
||||
{
|
||||
private PwGroup _pwGroup;
|
||||
|
||||
public ObservableCollection<EntryVm> Entries { get; set; }
|
||||
public ObservableCollection<GroupVm> Groups { get; set; }
|
||||
public string Name { get; set; }
|
||||
@@ -35,11 +37,23 @@ namespace ModernKeePass.ViewModels
|
||||
|
||||
public GroupVm(PwGroup group)
|
||||
{
|
||||
_pwGroup = group;
|
||||
Name = group.Name;
|
||||
Entries = new ObservableCollection<EntryVm>(group.Entries.Select(e => new EntryVm(e)));
|
||||
Groups = new ObservableCollection<GroupVm>(group.Groups.Select(g => new GroupVm(g)));
|
||||
}
|
||||
|
||||
public void AddGroup(string title)
|
||||
{
|
||||
var pwGroup = new PwGroup
|
||||
{
|
||||
Name = title
|
||||
};
|
||||
Groups.Add(new GroupVm(pwGroup));
|
||||
NotifyPropertyChanged("Groups");
|
||||
this._pwGroup.Groups.Add(pwGroup);
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
public void NotifyPropertyChanged(string propertyName)
|
||||
|
Reference in New Issue
Block a user