Updating - Added UI for updating (actual update not yet implemented)

Shared UI - Added message service for easy access to the snackbar 🍟
This commit is contained in:
SpoinkyNL committed 2021-01-10 00:20:01 +01:00
1 parent 45fef11a67
commit 883fccef7b
21 files changed
+777 -54

No files matched your search

@@ -8,16 +8,15 @@ namespace Artemis.UI.Screens.ProfileEditor.Dialogs
{
public class ProfileExportViewModel : DialogViewModelBase
{
private readonly ISnackbarMessageQueue _mainMessageQueue;
private readonly IProfileService _profileService;
private readonly IMessageService _messageService;
public ProfileExportViewModel(ProfileDescriptor profileDescriptor, IProfileService profileService, ISnackbarMessageQueue mainMessageQueue)
public ProfileExportViewModel(ProfileDescriptor profileDescriptor, IProfileService profileService, IMessageService messageService)
{
ProfileDescriptor = profileDescriptor;
_profileService = profileService;
_mainMessageQueue = mainMessageQueue;
_messageService = messageService;
}
public ProfileDescriptor ProfileDescriptor { get; }
@@ -26,7 +25,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Dialogs
{
string encoded = _profileService.ExportProfile(ProfileDescriptor);
Clipboard.SetText(encoded);
_mainMessageQueue.Enqueue("Profile contents exported to clipboard.");
_messageService.ShowMessage("Profile contents exported to clipboard.");
Session.Close();
}
@@ -11,15 +11,16 @@ namespace Artemis.UI.Screens.ProfileEditor.Dialogs
{
private readonly ISnackbarMessageQueue _mainMessageQueue;
private readonly IProfileService _profileService;
private readonly IMessageService _messageService;
private string _profileJson;
public ProfileImportViewModel(ProfileModule profileModule, IProfileService profileService, ISnackbarMessageQueue mainMessageQueue)
public ProfileImportViewModel(ProfileModule profileModule, IProfileService profileService, IMessageService messageService)
{
ProfileModule = profileModule;
Document = new TextDocument();
_profileService = profileService;
_mainMessageQueue = mainMessageQueue;
_messageService = messageService;
}
public ProfileModule ProfileModule { get; }
@@ -34,7 +35,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Dialogs
public void Accept()
{
ProfileDescriptor descriptor = _profileService.ImportProfile(Document.Text, ProfileModule);
_mainMessageQueue.Enqueue("Profile imported.");
_messageService.ShowMessage("Profile imported.");
Session.Close(descriptor);
}
}