BusyIndicator.xaml.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. 
  2. using System.Windows;
  3. namespace MECF.Framework.UI.Client.ClientBase.UserControls
  4. {
  5. /// <summary>
  6. /// Interaction logic for BusyIndicator.xaml
  7. /// </summary>
  8. public partial class BusyIndicator
  9. {
  10. public BusyIndicator()
  11. {
  12. InitializeComponent();
  13. }
  14. #region Properties
  15. public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(
  16. "Message", typeof(string), typeof(BusyIndicator), new PropertyMetadata(default(string)));
  17. public string Message
  18. {
  19. get => (string)GetValue(MessageProperty);
  20. set => SetValue(MessageProperty, value);
  21. }
  22. #endregion
  23. #region Routed Events
  24. // Register a custom routed event using the Bubble routing strategy.
  25. public static readonly RoutedEvent CanceledEvent = EventManager.RegisterRoutedEvent(
  26. name: nameof(Canceled),
  27. routingStrategy: RoutingStrategy.Bubble,
  28. handlerType: typeof(RoutedEventHandler),
  29. ownerType: typeof(ParameterNodeTreeViewControl));
  30. // Provide CLR accessors for assigning an event handler.
  31. public event RoutedEventHandler Canceled
  32. {
  33. add => AddHandler(CanceledEvent, value);
  34. remove => RemoveHandler(CanceledEvent, value);
  35. }
  36. #endregion
  37. #region Events
  38. private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
  39. {
  40. RaiseEvent(new RoutedEventArgs(CanceledEvent));
  41. }
  42. #endregion
  43. }
  44. }