Make Hyperion dialog inherit from Fluent dialog

This commit is contained in:
pizzaboxer 2023-05-10 13:41:36 +01:00
parent 703181b336
commit 26a7dfe5af
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
2 changed files with 6 additions and 41 deletions

View File

@ -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

View File

@ -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();
}
}
}