PropertyItemsControl.cs 497 B

123456789101112131415161718
  1. using System.Windows.Controls;
  2. namespace HandyControl.Controls;
  3. public class PropertyItemsControl : ListBox
  4. {
  5. protected override bool IsItemItsOwnContainerOverride(object item) => item is PropertyItem;
  6. public PropertyItemsControl()
  7. {
  8. #if !NET40
  9. VirtualizingPanel.SetIsVirtualizingWhenGrouping(this, true);
  10. VirtualizingPanel.SetScrollUnit(this, ScrollUnit.Pixel);
  11. #else
  12. System.Windows.Controls.ScrollViewer.SetCanContentScroll(this, false);
  13. #endif
  14. }
  15. }