Restore Main and Settings Page

Entry and Group delete events converted to commands
Code cleanup
This commit is contained in:
Geoffroy BONNEVILLE
2020-04-22 11:58:06 +02:00
parent 1df9cbce1c
commit a88051bc0c
13 changed files with 144 additions and 164 deletions

View File

@@ -154,10 +154,19 @@ namespace ModernKeePass.ViewModels
_resource.GetResourceValue("EntityDeleteCancelButton"),
async isOk =>
{
var text = IsRecycleOnDelete ? _resource.GetResourceValue("GroupRecycled") : _resource.GetResourceValue("GroupDeleted");
//ToastNotificationHelper.ShowMovedToast(Entity, resource.GetResourceValue("EntityDeleting"), text);
await MarkForDelete(_resource.GetResourceValue("RecycleBinTitle"));
_navigation.GoBack();
if (isOk)
{
var text = IsRecycleOnDelete
? _resource.GetResourceValue("GroupRecycled")
: _resource.GetResourceValue("GroupDeleted");
//ToastNotificationHelper.ShowMovedToast(Entity, resource.GetResourceValue("EntityDeleting"), text);
await _mediator.Send(new DeleteGroupCommand
{
GroupId = _group.Id, ParentGroupId = _group.ParentGroupId,
RecycleBinName = _resource.GetResourceValue("RecycleBinTitle")
});
_navigation.GoBack();
}
});
}
@@ -181,11 +190,6 @@ namespace ModernKeePass.ViewModels
IsNew = true
});
}
public async Task MarkForDelete(string recycleBinTitle)
{
await _mediator.Send(new DeleteGroupCommand { GroupId = _group.Id, ParentGroupId = _group.ParentGroupId, RecycleBinName = recycleBinTitle });
}
public async Task Move(GroupVm destination)
{