From bb4c535244710f596904cd4a3c46ef50bf13992b Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Tue, 26 Mar 2024 16:11:14 -0400 Subject: [PATCH 1/3] new update control WIP --- .idea/.idea.SPTInstaller/.idea/avalonia.xml | 2 ++ SPTInstaller/App.axaml | 2 ++ SPTInstaller/Assets/Styles.axaml | 12 ++++----- .../CustomControls/PreCheckItem.axaml | 3 +-- .../CustomControls/UpdateButton.axaml | 27 +++++++++++++++++++ .../CustomControls/UpdateButton.axaml.cs | 24 +++++++++++++++++ SPTInstaller/SPTInstaller.csproj | 4 +-- SPTInstaller/Views/PreChecksView.axaml | 26 ++++++++++-------- 8 files changed, 78 insertions(+), 22 deletions(-) create mode 100644 SPTInstaller/CustomControls/UpdateButton.axaml create mode 100644 SPTInstaller/CustomControls/UpdateButton.axaml.cs diff --git a/.idea/.idea.SPTInstaller/.idea/avalonia.xml b/.idea/.idea.SPTInstaller/.idea/avalonia.xml index 29981b3..1ff4164 100644 --- a/.idea/.idea.SPTInstaller/.idea/avalonia.xml +++ b/.idea/.idea.SPTInstaller/.idea/avalonia.xml @@ -8,10 +8,12 @@ + + diff --git a/SPTInstaller/App.axaml b/SPTInstaller/App.axaml index 1f4245f..1c0a3d8 100644 --- a/SPTInstaller/App.axaml +++ b/SPTInstaller/App.axaml @@ -21,6 +21,7 @@ #FFFFFF #282828 #323947 + #444259 @@ -28,6 +29,7 @@ + diff --git a/SPTInstaller/Assets/Styles.axaml b/SPTInstaller/Assets/Styles.axaml index 35af7af..ce89e48 100644 --- a/SPTInstaller/Assets/Styles.axaml +++ b/SPTInstaller/Assets/Styles.axaml @@ -123,16 +123,13 @@ - - @@ -159,6 +156,7 @@ diff --git a/SPTInstaller/CustomControls/PreCheckItem.axaml b/SPTInstaller/CustomControls/PreCheckItem.axaml index 95f6c6d..3808760 100644 --- a/SPTInstaller/CustomControls/PreCheckItem.axaml +++ b/SPTInstaller/CustomControls/PreCheckItem.axaml @@ -38,8 +38,7 @@ diff --git a/SPTInstaller/CustomControls/UpdateButton.axaml b/SPTInstaller/CustomControls/UpdateButton.axaml new file mode 100644 index 0000000..8e73bbb --- /dev/null +++ b/SPTInstaller/CustomControls/UpdateButton.axaml @@ -0,0 +1,27 @@ + + + + + + + + + - + + + + + + + + + + + + + + From 992931b15c6bae12ef4542914e2089cb0c860c3e Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Tue, 26 Mar 2024 18:59:22 -0400 Subject: [PATCH 2/3] add properties to control --- .../CustomControls/UpdateButton.axaml.cs | 87 ++++++++++++++++--- 1 file changed, 74 insertions(+), 13 deletions(-) diff --git a/SPTInstaller/CustomControls/UpdateButton.axaml.cs b/SPTInstaller/CustomControls/UpdateButton.axaml.cs index 57126f1..e5c6b03 100644 --- a/SPTInstaller/CustomControls/UpdateButton.axaml.cs +++ b/SPTInstaller/CustomControls/UpdateButton.axaml.cs @@ -1,6 +1,6 @@ -using Avalonia; +using System.Windows.Input; +using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace SPTInstaller.CustomControls; @@ -10,15 +10,76 @@ public partial class UpdateButton : UserControl { InitializeComponent(); } - - - - // InfoText="{Binding UpdateInfo.UpdateInfoText}" - // ShowUpdateCard="{Binding UpdateInfo.ShowCard}" - // NotNowCommand="{Binding DismissUpdateCommand}" - // UpdateInstallerCommand="{Binding UpdateInstallerCommand}" - // Updating="{Binding UpdateInfo.Updating}" - // DownloadProgress="{Binding UpdateInfo.DownloadProgress}" - // IndeterminateProgress="{Binding UpdateInfo.CheckingForUpdates}" - // UpdateAvailable="{Binding UpdateInfo.UpdateAvailable}" + + public static readonly StyledProperty InfoTextProperty = AvaloniaProperty.Register( + "InfoText"); + + public string InfoText + { + get => GetValue(InfoTextProperty); + set => SetValue(InfoTextProperty, value); + } + + public static readonly StyledProperty ShowProperty = AvaloniaProperty.Register( + "Show"); + + public bool Show + { + get => GetValue(ShowProperty); + set => SetValue(ShowProperty, value); + } + + public static readonly StyledProperty DismissCommandProperty = AvaloniaProperty.Register( + "DismissCommand"); + + public ICommand DismissCommand + { + get => GetValue(DismissCommandProperty); + set => SetValue(DismissCommandProperty, value); + } + + public static readonly StyledProperty UpdateCommandProperty = AvaloniaProperty.Register( + "UpdateCommand"); + + public ICommand UpdateCommand + { + get => GetValue(UpdateCommandProperty); + set => SetValue(UpdateCommandProperty, value); + } + + public static readonly StyledProperty UpdatingProperty = AvaloniaProperty.Register( + "Updating"); + + public bool Updating + { + get => GetValue(UpdatingProperty); + set => SetValue(UpdatingProperty, value); + } + + public static readonly StyledProperty DownloadProgressProperty = AvaloniaProperty.Register( + "DownloadProgress"); + + public int DownloadProgress + { + get => GetValue(DownloadProgressProperty); + set => SetValue(DownloadProgressProperty, value); + } + + public static readonly StyledProperty IsIndeterminateProperty = AvaloniaProperty.Register( + "IsIndeterminate"); + + public bool IsIndeterminate + { + get => GetValue(IsIndeterminateProperty); + set => SetValue(IsIndeterminateProperty, value); + } + + public static readonly StyledProperty UpdateAvailableProperty = AvaloniaProperty.Register( + "UpdateAvailable"); + + public bool UpdateAvailable + { + get => GetValue(UpdateAvailableProperty); + set => SetValue(UpdateAvailableProperty, value); + } } \ No newline at end of file From 94b7d0490899e318d74956127b42dad6eb616e25 Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Wed, 27 Mar 2024 09:26:11 -0400 Subject: [PATCH 3/3] finish update button controls --- .../CustomControls/UpdateButton.axaml | 32 +++++++++++++++---- .../CustomControls/UpdateButton.axaml.cs | 10 +++--- SPTInstaller/Models/InstallerUpdateInfo.cs | 30 +++++------------ SPTInstaller/ViewModels/PreChecksViewModel.cs | 4 +-- SPTInstaller/Views/PreChecksView.axaml | 29 ++++++++--------- 5 files changed, 55 insertions(+), 50 deletions(-) diff --git a/SPTInstaller/CustomControls/UpdateButton.axaml b/SPTInstaller/CustomControls/UpdateButton.axaml index 8e73bbb..4b2f766 100644 --- a/SPTInstaller/CustomControls/UpdateButton.axaml +++ b/SPTInstaller/CustomControls/UpdateButton.axaml @@ -10,17 +10,37 @@ - - - - - - - - - - - - - - - +