You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
831 B

  1. using System.Windows;
  2. using System.Windows.Controls;
  3. namespace BPA.UIControl
  4. {
  5. /// <summary>
  6. /// 树形列表项
  7. /// </summary>
  8. [StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(TreeListViewItem))]
  9. public class TreeListViewItem : TreeViewItem
  10. {
  11. static TreeListViewItem()
  12. {
  13. DefaultStyleKeyProperty.OverrideMetadata(typeof(TreeListViewItem), new FrameworkPropertyMetadata(typeof(TreeListViewItem)));
  14. }
  15. /// <inheritdoc/>
  16. protected override DependencyObject GetContainerForItemOverride()
  17. {
  18. return new TreeListViewItem();
  19. }
  20. /// <inheritdoc/>
  21. protected override bool IsItemItsOwnContainerOverride(object item)
  22. {
  23. return item is TreeListViewItem;
  24. }
  25. }
  26. }