97 lines
3.0 KiB
C#
Raw Normal View History

2024-03-26 18:59:22 -04:00
using System.Windows.Input;
using Avalonia;
2024-03-26 16:11:14 -04:00
using Avalonia.Controls;
namespace SPTInstaller.CustomControls;
public partial class UpdateButton : UserControl
{
public UpdateButton()
{
InitializeComponent();
}
2024-05-01 10:31:55 -04:00
2024-03-26 18:59:22 -04:00
public static readonly StyledProperty<string> InfoTextProperty = AvaloniaProperty.Register<UpdateButton, string>(
"InfoText");
2024-05-01 10:31:55 -04:00
2024-03-26 18:59:22 -04:00
public string InfoText
{
get => GetValue(InfoTextProperty);
set => SetValue(InfoTextProperty, value);
}
2024-05-01 10:31:55 -04:00
public static readonly StyledProperty<bool> CheckingForUpdateProperty =
AvaloniaProperty.Register<UpdateButton, bool>(
"CheckingForUpdate");
2024-03-27 09:26:11 -04:00
public bool CheckingForUpdate
2024-03-26 18:59:22 -04:00
{
2024-03-27 09:26:11 -04:00
get => GetValue(CheckingForUpdateProperty);
set => SetValue(CheckingForUpdateProperty, value);
2024-03-26 18:59:22 -04:00
}
2024-05-01 10:31:55 -04:00
public static readonly StyledProperty<ICommand> DismissCommandProperty =
AvaloniaProperty.Register<UpdateButton, ICommand>(
"DismissCommand");
2024-03-26 18:59:22 -04:00
public ICommand DismissCommand
{
get => GetValue(DismissCommandProperty);
set => SetValue(DismissCommandProperty, value);
}
2024-05-01 10:31:55 -04:00
public static readonly StyledProperty<ICommand> UpdateCommandProperty =
AvaloniaProperty.Register<UpdateButton, ICommand>(
"UpdateCommand");
2024-03-26 18:59:22 -04:00
public ICommand UpdateCommand
{
get => GetValue(UpdateCommandProperty);
set => SetValue(UpdateCommandProperty, value);
}
2024-05-01 10:31:55 -04:00
2024-05-01 12:00:30 -04:00
public static readonly StyledProperty<ICommand> WhatsNewCommandProperty =
AvaloniaProperty.Register<UpdateButton, ICommand>("WhatsNewCommand");
public ICommand WhatsNewCommand
{
get => GetValue(WhatsNewCommandProperty);
set => SetValue(WhatsNewCommandProperty, value);
}
2024-03-26 18:59:22 -04:00
public static readonly StyledProperty<bool> UpdatingProperty = AvaloniaProperty.Register<UpdateButton, bool>(
"Updating");
2024-05-01 10:31:55 -04:00
2024-03-26 18:59:22 -04:00
public bool Updating
{
get => GetValue(UpdatingProperty);
set => SetValue(UpdatingProperty, value);
}
2024-05-01 10:31:55 -04:00
2024-03-26 18:59:22 -04:00
public static readonly StyledProperty<int> DownloadProgressProperty = AvaloniaProperty.Register<UpdateButton, int>(
"DownloadProgress");
2024-05-01 10:31:55 -04:00
2024-03-26 18:59:22 -04:00
public int DownloadProgress
{
get => GetValue(DownloadProgressProperty);
set => SetValue(DownloadProgressProperty, value);
}
2024-05-01 10:31:55 -04:00
2024-03-26 18:59:22 -04:00
public static readonly StyledProperty<bool> IsIndeterminateProperty = AvaloniaProperty.Register<UpdateButton, bool>(
"IsIndeterminate");
2024-05-01 10:31:55 -04:00
2024-03-26 18:59:22 -04:00
public bool IsIndeterminate
{
get => GetValue(IsIndeterminateProperty);
set => SetValue(IsIndeterminateProperty, value);
}
2024-05-01 10:31:55 -04:00
2024-03-26 18:59:22 -04:00
public static readonly StyledProperty<bool> UpdateAvailableProperty = AvaloniaProperty.Register<UpdateButton, bool>(
"UpdateAvailable");
2024-05-01 10:31:55 -04:00
2024-03-26 18:59:22 -04:00
public bool UpdateAvailable
{
get => GetValue(UpdateAvailableProperty);
set => SetValue(UpdateAvailableProperty, value);
}
2024-03-26 16:11:14 -04:00
}