UI - Add PropertyChanged.SourceGenerator and use it in the profile editor

This commit is contained in:
Robert committed 2023-10-18 22:50:28 +02:00
1 parent fb6845be5d
commit 6921561317
24 files changed
+139 -311

No files matched your search

@@ -19,11 +19,12 @@ using Artemis.UI.Shared.Services.MainWindow;
using Artemis.UI.Shared.Services.ProfileEditor;
using DynamicData;
using DynamicData.Binding;
using PropertyChanged.SourceGenerator;
using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor;
public class ProfileEditorViewModel : RoutableScreen<ProfileEditorViewModelParameters>, IMainScreenViewModel
public partial class ProfileEditorViewModel : RoutableScreen<ProfileEditorViewModelParameters>, IMainScreenViewModel
{
private readonly IProfileEditorService _profileEditorService;
private readonly IProfileService _profileService;
@@ -31,8 +32,9 @@ public class ProfileEditorViewModel : RoutableScreen<ProfileEditorViewModelParam
private readonly IMainWindowService _mainWindowService;
private readonly SourceList<IToolViewModel> _tools;
private ObservableAsPropertyHelper<ProfileEditorHistory?>? _history;
private ProfileConfiguration? _profileConfiguration;
private ObservableAsPropertyHelper<bool>? _suspendedEditing;
[Notify] private ProfileConfiguration? _profileConfiguration;
/// <inheritdoc />
public ProfileEditorViewModel(IProfileService profileService,
@@ -94,12 +96,6 @@ public class ProfileEditorViewModel : RoutableScreen<ProfileEditorViewModelParam
ToggleAutoSuspend = ReactiveCommand.Create(ExecuteToggleAutoSuspend);
}
public ProfileConfiguration? ProfileConfiguration
{
get => _profileConfiguration;
set => RaiseAndSetIfChanged(ref _profileConfiguration, value);
}
public VisualEditorViewModel? VisualEditorViewModel { get; }
public ProfileTreeViewModel? ProfileTreeViewModel { get; }
public PropertiesViewModel? PropertiesViewModel { get; }