Profile editor - Added profile rename

Profile editor - Cleaned up buttons next to profile selection
This commit is contained in:
Robert committed 2020-12-17 21:09:42 +01:00
1 parent 3792dd53d2
commit e61a031485
8 files changed
+174 -56

No files matched your search

@@ -182,6 +182,21 @@ namespace Artemis.UI.Screens.ProfileEditor
RemoveProfile(SelectedProfile);
}
public async Task RenameActiveProfile()
{
if (_profileEditorService.SelectedProfile == null)
return;
Profile profile = _profileEditorService.SelectedProfile;
object result = await DialogService.ShowDialog<ProfileEditViewModel>(new Dictionary<string, object> {{"profile", profile}});
if (result is string name)
{
profile.Name = name;
_profileEditorService.UpdateSelectedProfile();
SelectedProfile.Update();
}
}
public async Task ExportActiveProfile()
{
await DialogService.ShowDialog<ProfileExportViewModel>(new Dictionary<string, object>
@@ -228,7 +243,7 @@ namespace Artemis.UI.Screens.ProfileEditor
await Task.Delay(50);
focusedElement?.Focus();
});
_snackbarMessageQueue.Enqueue("Undid profile update", "REDO", Redo);
}