ListViewImitationUniform.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. namespace SHJX.Service.Library.ImitationUniform.elemetation
  4. {
  5. public class ListViewImitationUniform : ListView
  6. {
  7. static ListViewImitationUniform()
  8. {
  9. DefaultStyleKeyProperty.OverrideMetadata(typeof(ListViewImitationUniform), new FrameworkPropertyMetadata(typeof(ListViewImitationUniform)));
  10. }
  11. public static readonly DependencyProperty ItemWidthProperty = WrapPanel.ItemWidthProperty.AddOwner(typeof(ListViewImitationUniform));
  12. public double ItemWidth
  13. {
  14. get { return (double)GetValue(ItemWidthProperty); }
  15. set { SetValue(ItemWidthProperty, value); }
  16. }
  17. public static readonly DependencyProperty ItemHeightProperty = WrapPanel.ItemHeightProperty.AddOwner(typeof(ListViewImitationUniform));
  18. public double ItemHeight
  19. {
  20. get { return (double)GetValue(ItemHeightProperty); }
  21. set { SetValue(ItemHeightProperty, value); }
  22. }
  23. public static readonly DependencyProperty ItemColumnsProperty = DependencyProperty.Register(nameof(ItemColumns),
  24. typeof(double), typeof(ListViewImitationUniform), new PropertyMetadata(0d));
  25. public double ItemColumns
  26. {
  27. get { return (double)GetValue(ItemColumnsProperty); }
  28. set { SetValue(ItemColumnsProperty, value); }
  29. }
  30. public static readonly DependencyProperty ItemRowsProperty = DependencyProperty.Register(nameof(ItemRows),
  31. typeof(double), typeof(ListViewImitationUniform), new PropertyMetadata(0d));
  32. public double ItemRows
  33. {
  34. get { return (double)GetValue(ItemRowsProperty); }
  35. set { SetValue(ItemRowsProperty, value); }
  36. }
  37. }
  38. }