add properties to control
This commit is contained in:
parent
bb4c535244
commit
992931b15c
@ -1,6 +1,6 @@
|
|||||||
using Avalonia;
|
using System.Windows.Input;
|
||||||
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace SPTInstaller.CustomControls;
|
namespace SPTInstaller.CustomControls;
|
||||||
|
|
||||||
@ -11,14 +11,75 @@ public partial class UpdateButton : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static readonly StyledProperty<string> InfoTextProperty = AvaloniaProperty.Register<UpdateButton, string>(
|
||||||
|
"InfoText");
|
||||||
|
|
||||||
|
public string InfoText
|
||||||
|
{
|
||||||
|
get => GetValue(InfoTextProperty);
|
||||||
|
set => SetValue(InfoTextProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
// InfoText="{Binding UpdateInfo.UpdateInfoText}"
|
public static readonly StyledProperty<bool> ShowProperty = AvaloniaProperty.Register<UpdateButton, bool>(
|
||||||
// ShowUpdateCard="{Binding UpdateInfo.ShowCard}"
|
"Show");
|
||||||
// NotNowCommand="{Binding DismissUpdateCommand}"
|
|
||||||
// UpdateInstallerCommand="{Binding UpdateInstallerCommand}"
|
public bool Show
|
||||||
// Updating="{Binding UpdateInfo.Updating}"
|
{
|
||||||
// DownloadProgress="{Binding UpdateInfo.DownloadProgress}"
|
get => GetValue(ShowProperty);
|
||||||
// IndeterminateProgress="{Binding UpdateInfo.CheckingForUpdates}"
|
set => SetValue(ShowProperty, value);
|
||||||
// UpdateAvailable="{Binding UpdateInfo.UpdateAvailable}"
|
}
|
||||||
|
|
||||||
|
public static readonly StyledProperty<ICommand> DismissCommandProperty = AvaloniaProperty.Register<UpdateButton, ICommand>(
|
||||||
|
"DismissCommand");
|
||||||
|
|
||||||
|
public ICommand DismissCommand
|
||||||
|
{
|
||||||
|
get => GetValue(DismissCommandProperty);
|
||||||
|
set => SetValue(DismissCommandProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly StyledProperty<ICommand> UpdateCommandProperty = AvaloniaProperty.Register<UpdateButton, ICommand>(
|
||||||
|
"UpdateCommand");
|
||||||
|
|
||||||
|
public ICommand UpdateCommand
|
||||||
|
{
|
||||||
|
get => GetValue(UpdateCommandProperty);
|
||||||
|
set => SetValue(UpdateCommandProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly StyledProperty<bool> UpdatingProperty = AvaloniaProperty.Register<UpdateButton, bool>(
|
||||||
|
"Updating");
|
||||||
|
|
||||||
|
public bool Updating
|
||||||
|
{
|
||||||
|
get => GetValue(UpdatingProperty);
|
||||||
|
set => SetValue(UpdatingProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly StyledProperty<int> DownloadProgressProperty = AvaloniaProperty.Register<UpdateButton, int>(
|
||||||
|
"DownloadProgress");
|
||||||
|
|
||||||
|
public int DownloadProgress
|
||||||
|
{
|
||||||
|
get => GetValue(DownloadProgressProperty);
|
||||||
|
set => SetValue(DownloadProgressProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly StyledProperty<bool> IsIndeterminateProperty = AvaloniaProperty.Register<UpdateButton, bool>(
|
||||||
|
"IsIndeterminate");
|
||||||
|
|
||||||
|
public bool IsIndeterminate
|
||||||
|
{
|
||||||
|
get => GetValue(IsIndeterminateProperty);
|
||||||
|
set => SetValue(IsIndeterminateProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly StyledProperty<bool> UpdateAvailableProperty = AvaloniaProperty.Register<UpdateButton, bool>(
|
||||||
|
"UpdateAvailable");
|
||||||
|
|
||||||
|
public bool UpdateAvailable
|
||||||
|
{
|
||||||
|
get => GetValue(UpdateAvailableProperty);
|
||||||
|
set => SetValue(UpdateAvailableProperty, value);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user