BusyArea.axaml.cs 889 B

123456789101112131415161718192021222324252627282930313233343536
  1. using Avalonia;
  2. using Avalonia.Controls;
  3. using Avalonia.Markup.Xaml;
  4. namespace SukiUI.Controls;
  5. public partial class BusyArea : UserControl
  6. {
  7. public BusyArea()
  8. {
  9. InitializeComponent();
  10. }
  11. private void InitializeComponent()
  12. {
  13. AvaloniaXamlLoader.Load(this);
  14. }
  15. public static readonly StyledProperty<bool> IsBusyProperty =
  16. AvaloniaProperty.Register<BusyArea, bool>(nameof(IsBusy), defaultValue: false);
  17. public bool IsBusy
  18. {
  19. get { return GetValue(IsBusyProperty); }
  20. set { SetValue(IsBusyProperty, value); }
  21. }
  22. public static readonly StyledProperty<string?> BusyTextProperty =
  23. AvaloniaProperty.Register<BusyArea, string?>(nameof(BusyText), defaultValue: null);
  24. public string? BusyText
  25. {
  26. get => GetValue(BusyTextProperty);
  27. set => SetValue(BusyTextProperty, value);
  28. }
  29. }