예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemVirtualizer"/> class.
 /// </summary>
 /// <param name="owner"></param>
 public ItemVirtualizer(ItemsPresenter owner)
 {
     Owner         = owner;
     _scrollViewer = VirtualizingPanel.FindAncestorOfType <ScrollViewer>();
     if ((owner.TemplatedParent is ItemsControl ic) && !(owner.TemplatedParent is GroupItem))
     {
         GroupControl = new GroupController(ic, Vertical);
     }
예제 #2
0
 public RealizedItems(ItemsPresenter owner, GroupController groupControl, int id)
 {
     _owner        = owner;
     _panel        = owner.Panel;
     _items        = owner.Items;
     _generator    = owner.ItemContainerGenerator;
     _scrollViewer = owner.FindAncestorOfType <ScrollViewer>();
     _id           = id;
     _cache        = owner.VirtualizingCache;
     _groupControl = groupControl;
     if (owner.VirtualizationMode == ItemVirtualizationMode.Logical)
     {
         _info = new RealizedItemsInfo2(_items, groupControl.Vertical, _cache, groupControl.TemplatedParent);
     }
     else
     {
         _info = new RealizedItemsInfo(_items, groupControl.Vertical, _cache, groupControl.TemplatedParent);
     }
 }