UI - Use PropertyChanged.SourceGenerator in workshop

This commit is contained in:
Robert committed 2023-10-20 20:00:07 +02:00
1 parent 8f1509fc28
commit d656c6960d
28 files changed
+119 -411

No files matched your search

@@ -10,18 +10,19 @@ using Artemis.UI.Shared.Services;
using Artemis.UI.Shared.Services.Builders;
using Artemis.UI.Shared.Utilities;
using Artemis.WebClient.Workshop;
using PropertyChanged.SourceGenerator;
using ReactiveUI;
using StrawberryShake;
namespace Artemis.UI.Screens.Workshop.Layout;
public class LayoutDetailsViewModel : RoutableScreen<WorkshopDetailParameters>
public partial class LayoutDetailsViewModel : RoutableScreen<WorkshopDetailParameters>
{
private readonly IWorkshopClient _client;
private readonly INotificationService _notificationService;
private readonly IWindowService _windowService;
private readonly ObservableAsPropertyHelper<DateTimeOffset?> _updatedAt;
private IGetEntryById_Entry? _entry;
[Notify(Setter.Private)] private IGetEntryById_Entry? _entry;
public LayoutDetailsViewModel(IWorkshopClient client, INotificationService notificationService, IWindowService windowService)
{
@@ -37,12 +38,6 @@ public class LayoutDetailsViewModel : RoutableScreen<WorkshopDetailParameters>
public DateTimeOffset? UpdatedAt => _updatedAt.Value;
public IGetEntryById_Entry? Entry
{
get => _entry;
private set => RaiseAndSetIfChanged(ref _entry, value);
}
public override async Task OnNavigating(WorkshopDetailParameters parameters, NavigationArguments args, CancellationToken cancellationToken)
{
await GetEntry(parameters.EntryId, cancellationToken);