Header_Content.xaml.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. namespace UniversalControls.Controls;
  4. /// <summary>
  5. /// Interaction logic for Header_Content.xaml
  6. /// </summary>
  7. public partial class Header_Content : UserControl
  8. {
  9. public Header_Content()
  10. {
  11. InitializeComponent();
  12. }
  13. public object Header
  14. {
  15. get { return (object)GetValue(HeaderProperty); }
  16. set { SetValue(HeaderProperty, value); }
  17. }
  18. // Using a DependencyProperty as the backing store for Header. This enables animation, styling, binding, etc...
  19. public static readonly DependencyProperty HeaderProperty =
  20. DependencyProperty.Register(nameof(Header), typeof(object), typeof(Header_Content), new PropertyMetadata(default));
  21. public object DisplayContent
  22. {
  23. get { return (object)GetValue(DisplayContentProperty); }
  24. set { SetValue(DisplayContentProperty, value); }
  25. }
  26. // Using a DependencyProperty as the backing store for Content. This enables animation, styling, binding, etc...
  27. public static readonly DependencyProperty DisplayContentProperty =
  28. DependencyProperty.Register(nameof(DisplayContent), typeof(object), typeof(Header_Content), new PropertyMetadata("-"));
  29. public Thickness ContentMargin
  30. {
  31. get { return (Thickness)GetValue(ContentMarginProperty); }
  32. set { SetValue(ContentMarginProperty, value); }
  33. }
  34. // Using a DependencyProperty as the backing store for ContentMargin. This enables animation, styling, binding, etc...
  35. public static readonly DependencyProperty ContentMarginProperty =
  36. DependencyProperty.Register(nameof(ContentMargin), typeof(Thickness), typeof(Header_Content), new PropertyMetadata(new Thickness(8, 0, 0, 0)));
  37. public float HeaderWidth
  38. {
  39. get { return (float)GetValue(HeaderWidthProperty); }
  40. set { SetValue(HeaderWidthProperty, value); }
  41. }
  42. // Using a DependencyProperty as the backing store for HeaderWidth. This enables animation, styling, binding, etc...
  43. public static readonly DependencyProperty HeaderWidthProperty =
  44. DependencyProperty.Register(nameof(HeaderWidth), typeof(float), typeof(Header_Content), new PropertyMetadata(32f));
  45. }