ProgressButton.cs 886 B

1234567891011121314151617181920212223242526
  1. using System.Windows;
  2. using System.Windows.Controls.Primitives;
  3. using HandyControl.Data;
  4. namespace HandyControl.Controls;
  5. public class ProgressButton : ToggleButton
  6. {
  7. public static readonly DependencyProperty ProgressStyleProperty = DependencyProperty.Register(
  8. nameof(ProgressStyle), typeof(Style), typeof(ProgressButton), new PropertyMetadata(default(Style)));
  9. public Style ProgressStyle
  10. {
  11. get => (Style) GetValue(ProgressStyleProperty);
  12. set => SetValue(ProgressStyleProperty, value);
  13. }
  14. public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register(
  15. nameof(Progress), typeof(double), typeof(ProgressButton), new PropertyMetadata(ValueBoxes.Double0Box));
  16. public double Progress
  17. {
  18. get => (double) GetValue(ProgressProperty);
  19. set => SetValue(ProgressProperty, value);
  20. }
  21. }