Added the option to close DB without saving

Changed the way recent files are retrieved
Stopped showing the DB Closed exception on suspend
Reordering entries works
Moved code from infra to application
Cleanup
This commit is contained in:
Geoffroy BONNEVILLE
2020-04-09 19:43:06 +02:00
parent 14fd4634db
commit d972b6cb5a
35 changed files with 141 additions and 100 deletions

View File

@@ -219,7 +219,7 @@ namespace ModernKeePass.ViewModels
public EntryDetailVm() { }
internal EntryDetailVm(string entryId, bool isNewEntry = false) : this(entryId, App.Services.GetService<IMediator>(), isNewEntry) { }
internal EntryDetailVm(string entryId, bool isNewEntry = false) : this(entryId, App.Services.GetRequiredService<IMediator>(), isNewEntry) { }
public EntryDetailVm(string entryId, IMediator mediator, bool isNewEntry = false)
{
@@ -232,7 +232,7 @@ namespace ModernKeePass.ViewModels
if (isNewEntry) GeneratePassword().GetAwaiter().GetResult();
IsSelected = true;
SaveCommand = new RelayCommand(() => _mediator.Send(new SaveDatabaseCommand()));
SaveCommand = new RelayCommand(async () => await _mediator.Send(new SaveDatabaseCommand()));
GeneratePasswordCommand = new RelayCommand(async () => await GeneratePassword());
UndoDeleteCommand = new RelayCommand(async () => await Move(_parent), () => _parent != null);
}