BililiveRecorder/BililiveRecorder.WPF/Controls/AutoFixProgressDialog.xaml.cs

40 lines
1.4 KiB
C#
Raw Permalink Normal View History

2021-05-02 21:34:27 +08:00
using System.Threading;
2021-02-27 18:14:44 +08:00
using System.Windows;
2021-05-02 21:34:27 +08:00
#nullable enable
2021-02-27 18:14:44 +08:00
namespace BililiveRecorder.WPF.Controls
{
/// <summary>
/// Interaction logic for AutoFixProgressDialog.xaml
/// </summary>
public partial class AutoFixProgressDialog
{
public AutoFixProgressDialog()
{
this.InitializeComponent();
}
public static readonly DependencyProperty ProgressProperty =
DependencyProperty.Register(nameof(Progress), typeof(int), typeof(AutoFixProgressDialog), new PropertyMetadata(0));
public int Progress
{
get => (int)this.GetValue(ProgressProperty);
set => this.SetValue(ProgressProperty, value);
}
2021-05-02 21:34:27 +08:00
public static readonly DependencyProperty CancelButtonVisibilityProperty =
DependencyProperty.Register(nameof(CancelButtonVisibility), typeof(Visibility), typeof(AutoFixProgressDialog), new PropertyMetadata(Visibility.Collapsed));
public Visibility CancelButtonVisibility
{
get => (Visibility)this.GetValue(CancelButtonVisibilityProperty);
set => this.SetValue(CancelButtonVisibilityProperty, value);
}
public CancellationTokenSource? CancellationTokenSource { get; set; }
private void Button_Click(object sender, RoutedEventArgs e) => this.CancellationTokenSource?.Cancel();
2021-02-27 18:14:44 +08:00
}
}