From 26a7dfe5af81026ed274ec6d7558dfef26345ba4 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Wed, 10 May 2023 13:41:36 +0100 Subject: [PATCH] Make Hyperion dialog inherit from Fluent dialog --- Bloxstrap/ViewModels/FluentDialogViewModel.cs | 10 ++--- .../ViewModels/HyperionDialogViewModel.cs | 37 ++----------------- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/Bloxstrap/ViewModels/FluentDialogViewModel.cs b/Bloxstrap/ViewModels/FluentDialogViewModel.cs index fc81ba1..881c4d4 100644 --- a/Bloxstrap/ViewModels/FluentDialogViewModel.cs +++ b/Bloxstrap/ViewModels/FluentDialogViewModel.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel; using System.Windows; using System.Windows.Input; using System.Windows.Media; + using CommunityToolkit.Mvvm.Input; + using Bloxstrap.Dialogs; -using Bloxstrap.Enums; using Bloxstrap.Extensions; namespace Bloxstrap.ViewModels diff --git a/Bloxstrap/ViewModels/HyperionDialogViewModel.cs b/Bloxstrap/ViewModels/HyperionDialogViewModel.cs index 6a5c452..c8415f2 100644 --- a/Bloxstrap/ViewModels/HyperionDialogViewModel.cs +++ b/Bloxstrap/ViewModels/HyperionDialogViewModel.cs @@ -1,45 +1,14 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Input; -using System.Windows.Media; -using CommunityToolkit.Mvvm.Input; +using System.ComponentModel; using Bloxstrap.Dialogs; -using Bloxstrap.Enums; -using Bloxstrap.Extensions; namespace Bloxstrap.ViewModels { - public class HyperionDialogViewModel : INotifyPropertyChanged + public class HyperionDialogViewModel : FluentDialogViewModel, INotifyPropertyChanged { - public event PropertyChangedEventHandler? PropertyChanged; - public void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - private readonly IBootstrapperDialog _dialog; - - public ICommand CancelInstallCommand => new RelayCommand(CancelInstall); - - public string Title => App.Settings.Prop.BootstrapperTitle; - public string Message { get; set; } = "Please wait..."; - public bool ProgressIndeterminate { get; set; } = true; - public int ProgressValue { get; set; } = 0; - - public Visibility CancelButtonVisibility { get; set; } = Visibility.Collapsed; - public string Version => $"Bloxstrap v{App.Version}"; - public HyperionDialogViewModel(IBootstrapperDialog dialog) + public HyperionDialogViewModel(IBootstrapperDialog dialog) : base(dialog) { - _dialog = dialog; - } - - private void CancelInstall() - { - _dialog.Bootstrapper?.CancelInstall(); - _dialog.CloseBootstrapper(); } } }