Updating group raise SaveCommand can execute

No need to click twice on history menu
Skipped first history entry as it is the same as the current entry
Stored SaveException innerexception as it is read more than once
This commit is contained in:
Geoffroy BONNEVILLE
2020-04-16 19:43:17 +02:00
parent f950564000
commit 2fb5b14085
7 changed files with 41 additions and 28 deletions

View File

@@ -50,13 +50,21 @@ namespace ModernKeePass.ViewModels
public string Title
{
get { return _group.Title; }
set { _mediator.Send(new UpdateGroupCommand {Group = _group, Title = value, Icon = _group.Icon}).Wait(); }
set
{
_mediator.Send(new UpdateGroupCommand {Group = _group, Title = value, Icon = _group.Icon}).Wait();
((RelayCommand)SaveCommand).RaiseCanExecuteChanged();
}
}
public Symbol Icon
{
get { return (Symbol) Enum.Parse(typeof(Symbol), _group.Icon.ToString()); }
set { _mediator.Send(new UpdateGroupCommand { Group = _group, Title = _group.Title, Icon = (Icon)Enum.Parse(typeof(Icon), value.ToString()) }).Wait(); }
set
{
_mediator.Send(new UpdateGroupCommand { Group = _group, Title = _group.Title, Icon = (Icon)Enum.Parse(typeof(Icon), value.ToString()) }).Wait();
((RelayCommand)SaveCommand).RaiseCanExecuteChanged();
}
}
public bool IsEditMode