NotificationBar.xaml.cs 1.6 KB

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