mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-23 11:01:26 -07:00
43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using System.ComponentModel;
|
|
using System.Windows;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
using Bloxstrap.Extensions;
|
|
|
|
namespace Bloxstrap.UI.BootstrapperDialogs.WPF.ViewModels
|
|
{
|
|
public class 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 ImageSource Icon { get; set; } = App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource();
|
|
public string Message { get; set; } = "Please wait...";
|
|
public bool ProgressIndeterminate { get; set; } = true;
|
|
public int ProgressValue { get; set; } = 0;
|
|
|
|
public bool CancelButtonEnabled { get; set; } = false;
|
|
public Visibility CancelButtonVisibility { get; set; } = Visibility.Collapsed;
|
|
public string CancelButtonText { get; set; } = "Cancel";
|
|
|
|
public FluentDialogViewModel(IBootstrapperDialog dialog)
|
|
{
|
|
_dialog = dialog;
|
|
}
|
|
|
|
private void CancelInstall()
|
|
{
|
|
_dialog.Bootstrapper?.CancelInstall();
|
|
_dialog.CloseBootstrapper();
|
|
}
|
|
}
|
|
}
|