From eb4f8b006cd86a6fc49eb0cc2dabd9fd5adffa1c Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Tue, 25 Jul 2023 22:07:48 -0400 Subject: [PATCH 1/6] precheck details view and viewmodel WIP --- SPTInstaller/App.axaml | 2 +- SPTInstaller/Assets/Styles.axaml | 16 ++++ .../CustomControls/DetailedPreCheckItem.axaml | 75 +++++++++++++++++++ .../DetailedPreCheckItem.axaml.cs | 19 +++++ .../CustomControls/PreCheckItem.axaml | 20 +---- .../ViewModels/DetailedPreChecksViewModel.cs | 9 +++ SPTInstaller/ViewModels/PreChecksViewModel.cs | 3 + .../Views/DetailedPreChecksView.axaml | 36 +++++++++ .../Views/DetailedPreChecksView.axaml.cs | 11 +++ SPTInstaller/Views/PreChecksView.axaml | 8 +- 10 files changed, 177 insertions(+), 22 deletions(-) create mode 100644 SPTInstaller/CustomControls/DetailedPreCheckItem.axaml create mode 100644 SPTInstaller/CustomControls/DetailedPreCheckItem.axaml.cs create mode 100644 SPTInstaller/ViewModels/DetailedPreChecksViewModel.cs create mode 100644 SPTInstaller/Views/DetailedPreChecksView.axaml create mode 100644 SPTInstaller/Views/DetailedPreChecksView.axaml.cs diff --git a/SPTInstaller/App.axaml b/SPTInstaller/App.axaml index 796915e..7070221 100644 --- a/SPTInstaller/App.axaml +++ b/SPTInstaller/App.axaml @@ -1,4 +1,4 @@ - diff --git a/SPTInstaller/Assets/Styles.axaml b/SPTInstaller/Assets/Styles.axaml index c4d4caf..bc52b97 100644 --- a/SPTInstaller/Assets/Styles.axaml +++ b/SPTInstaller/Assets/Styles.axaml @@ -184,4 +184,20 @@ + + + + + + + \ No newline at end of file diff --git a/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml b/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml new file mode 100644 index 0000000..d9564a5 --- /dev/null +++ b/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml.cs b/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml.cs new file mode 100644 index 0000000..9257626 --- /dev/null +++ b/SPTInstaller/CustomControls/DetailedPreCheckItem.axaml.cs @@ -0,0 +1,19 @@ +using Avalonia; + +namespace SPTInstaller.CustomControls; +public partial class DetailedPreCheckItem : PreCheckItem +{ + public DetailedPreCheckItem() + { + InitializeComponent(); + } + + public string PreCheckDetails + { + get => GetValue(PreCheckDetailsProperty); + set => SetValue(PreCheckDetailsProperty, value); + } + + public static readonly StyledProperty PreCheckDetailsProperty = + AvaloniaProperty.Register(nameof(PreCheckDetails)); +} diff --git a/SPTInstaller/CustomControls/PreCheckItem.axaml b/SPTInstaller/CustomControls/PreCheckItem.axaml index 6d539c7..332f0b9 100644 --- a/SPTInstaller/CustomControls/PreCheckItem.axaml +++ b/SPTInstaller/CustomControls/PreCheckItem.axaml @@ -1,4 +1,4 @@ - - @@ -29,23 +28,6 @@ - - - - - - diff --git a/SPTInstaller/ViewModels/DetailedPreChecksViewModel.cs b/SPTInstaller/ViewModels/DetailedPreChecksViewModel.cs new file mode 100644 index 0000000..83c5618 --- /dev/null +++ b/SPTInstaller/ViewModels/DetailedPreChecksViewModel.cs @@ -0,0 +1,9 @@ +using ReactiveUI; + +namespace SPTInstaller.ViewModels; +public class DetailedPreChecksViewModel : PreChecksViewModel +{ + public DetailedPreChecksViewModel(IScreen host) : base(host) + { + } +} diff --git a/SPTInstaller/ViewModels/PreChecksViewModel.cs b/SPTInstaller/ViewModels/PreChecksViewModel.cs index a448d55..d1a2ab9 100644 --- a/SPTInstaller/ViewModels/PreChecksViewModel.cs +++ b/SPTInstaller/ViewModels/PreChecksViewModel.cs @@ -15,6 +15,8 @@ public class PreChecksViewModel : ViewModelBase public ObservableCollection PreChecks { get; set; } = new(ServiceHelper.GetAll()); public ICommand StartInstallCommand { get; set; } + public ICommand ShowDetailedViewCommand { get; set; } + public string InstallPath { get => _installPath; @@ -43,6 +45,7 @@ public class PreChecksViewModel : ViewModelBase InstallPath = data.TargetInstallPath; StartInstallCommand = ReactiveCommand.Create(() => NavigateTo(new InstallViewModel(HostScreen))); + ShowDetailedViewCommand = ReactiveCommand.Create(() => NavigateTo(new DetailedPreChecksViewModel(HostScreen))); Task.Run(async () => { diff --git a/SPTInstaller/Views/DetailedPreChecksView.axaml b/SPTInstaller/Views/DetailedPreChecksView.axaml new file mode 100644 index 0000000..7fc3ec9 --- /dev/null +++ b/SPTInstaller/Views/DetailedPreChecksView.axaml @@ -0,0 +1,36 @@ + + + + diff --git a/SPTInstaller/Views/DetailedPreChecksView.axaml.cs b/SPTInstaller/Views/DetailedPreChecksView.axaml.cs new file mode 100644 index 0000000..90fbc02 --- /dev/null +++ b/SPTInstaller/Views/DetailedPreChecksView.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.ReactiveUI; +using SPTInstaller.ViewModels; + +namespace SPTInstaller.Views; +public partial class DetailedPreChecksView : ReactiveUserControl +{ + public DetailedPreChecksView() + { + InitializeComponent(); + } +} diff --git a/SPTInstaller/Views/PreChecksView.axaml b/SPTInstaller/Views/PreChecksView.axaml index 003e0d9..ace3912 100644 --- a/SPTInstaller/Views/PreChecksView.axaml +++ b/SPTInstaller/Views/PreChecksView.axaml @@ -1,4 +1,4 @@ - + RowDefinitions="10,*,AUTO,AUTO,AUTO,AUTO,*,10">