NotificationBar.xaml.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using SWRIS.Dtos;
  2. using System.Collections.ObjectModel;
  3. using System.Windows;
  4. using System.Windows.Controls;
  5. namespace SWRIS.Controls
  6. {
  7. /// <summary>
  8. /// NotificationBar.xaml 的交互逻辑
  9. /// </summary>
  10. public partial class NotificationBar : UserControl
  11. {
  12. public NotificationBar()
  13. {
  14. InitializeComponent();
  15. }
  16. public static readonly DependencyProperty MessagesProperty =
  17. DependencyProperty.Register("Messages", typeof(ObservableCollection<FaultsMessageDto>), typeof(NotificationBar),
  18. new PropertyMetadata(null));
  19. public ObservableCollection<FaultsMessageDto> Messages
  20. {
  21. get { return (ObservableCollection<FaultsMessageDto>)GetValue(MessagesProperty); }
  22. set { SetValue(MessagesProperty, value); }
  23. }
  24. public static readonly DependencyProperty CornerRadiusProperty =
  25. DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(NotificationBar),
  26. new PropertyMetadata(new CornerRadius(20, 20, 20, 20)));
  27. public CornerRadius CornerRadius
  28. {
  29. get { return (CornerRadius)GetValue(CornerRadiusProperty); }
  30. set { SetValue(CornerRadiusProperty, value); }
  31. }
  32. public static readonly DependencyProperty TextPaddingProperty =
  33. DependencyProperty.Register("TextPadding", typeof(Thickness), typeof(NotificationBar),
  34. new PropertyMetadata(new Thickness(15, 5, 10, 5)));
  35. public Thickness TextPadding
  36. {
  37. get { return (Thickness)GetValue(TextPaddingProperty); }
  38. set { SetValue(TextPaddingProperty, value); }
  39. }
  40. }
  41. }