Toast notifications and undo mechanism now works! (for group and entries)

This commit is contained in:
2017-10-18 10:32:51 +02:00
committed by BONNEVILLE Geoffroy
parent bc6e7d0097
commit dc62cedb74
8 changed files with 148 additions and 126 deletions

View File

@@ -97,23 +97,11 @@ namespace ModernKeePass.ViewModels
Entries.Add(newEntry);
return newEntry;
}
public void RemoveGroup()
{
_pwGroup.ParentGroup.Groups.Remove(_pwGroup);
ParentGroup.Groups.Remove(this);
}
public void RemoveEntry(EntryVm entry)
{
_pwGroup.Entries.Remove(entry.Entry);
Entries.Remove(entry);
}
public void MarkForDelete()
{
var app = (App)Application.Current;
app.PendingDeleteQueue.Enqueue(this);
app.PendingDeleteEntities.Add(Id, this);
ParentGroup.Groups.Remove(this);
}
@@ -121,5 +109,9 @@ namespace ModernKeePass.ViewModels
{
_pwGroup.ParentGroup.Groups.Remove(_pwGroup);
}
public void UndoDelete()
{
ParentGroup.Groups.Add(this);
}
}
}