1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Robert 2ee170b803 Workshop - Fixed deep linking to an entry
Workshop - Added the ability to upload new releases to existing submissions
2023-09-04 20:30:57 +02:00

51 lines
1.5 KiB
C#

using Artemis.UI.Screens.Workshop.CurrentUser;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using Artemis.WebClient.Workshop;
using DryIoc;
namespace Artemis.UI.Screens.Workshop.SubmissionWizard;
public class ReleaseWizardViewModel : ActivatableViewModelBase, IWorkshopWizardViewModel
{
private readonly SubmissionWizardState _state;
private SubmissionViewModel? _screen;
private bool _shouldClose;
public ReleaseWizardViewModel(IContainer container, IWindowService windowService, CurrentUserViewModel currentUserViewModel, IGetSubmittedEntryById_Entry entry)
{
_state = new SubmissionWizardState(this, container, windowService)
{
EntryType = entry.EntryType,
EntryId = entry.Id
};
WindowService = windowService;
CurrentUserViewModel = currentUserViewModel;
CurrentUserViewModel.AllowLogout = false;
Entry = entry;
_state.StartForCurrentEntry();
}
public IWindowService WindowService { get; }
public IGetSubmittedEntryById_Entry Entry { get; }
public CurrentUserViewModel CurrentUserViewModel { get; }
public SubmissionViewModel? Screen
{
get => _screen;
set
{
if (value != null)
value.State = _state;
RaiseAndSetIfChanged(ref _screen, value);
}
}
public bool ShouldClose
{
get => _shouldClose;
set => RaiseAndSetIfChanged(ref _shouldClose, value);
}
}