Removed half-baked import feature for now

No views depend on services anymore
Dirty status fully handled by behavior
This commit is contained in:
Geoffroy BONNEVILLE
2020-04-27 11:14:29 +02:00
parent 59ab43ca9c
commit 8e06bf4bb0
11 changed files with 34 additions and 113 deletions

View File

@@ -137,25 +137,34 @@ namespace ModernKeePass.ViewModels
Entries.CollectionChanged += Entries_CollectionChanged;
Groups = new ObservableCollection<GroupVm>(_group.SubGroups);
}
public void GoToEntry(string entryId, bool isNew = false)
{
_navigation.NavigateTo(Constants.Navigation.EntryPage, new NavigationItem
{
Id = entryId,
IsNew = isNew
});
}
public void GoToGroup(string entryId, bool isNew = false)
{
_navigation.NavigateTo(Constants.Navigation.GroupPage, new NavigationItem
{
Id = entryId,
IsNew = isNew
});
}
public async Task AddNewGroup(string name = "")
{
var group = await _mediator.Send(new CreateGroupCommand {Name = name, ParentGroup = _group});
_navigation.NavigateTo(Constants.Navigation.GroupPage, new NavigationItem
{
Id = group.Id,
IsNew = true
});
GoToGroup(group.Id, true);
}
public async Task AddNewEntry()
{
var entry = await _mediator.Send(new CreateEntryCommand { ParentGroup = _group });
_navigation.NavigateTo(Constants.Navigation.EntryPage, new NavigationItem
{
Id = entry.Id,
IsNew = true
});
GoToEntry(entry.Id, true);
}
public async Task Move(GroupVm destination)