@@ -594,13 +594,11 @@ protected virtual void UpdateItemsLayout(int fromPosition, bool shouldAdjustScro
594594#endif
595595    } 
596596
597- 
598- 
599597    protected  virtual  void  DetachCell ( VirtualizeListViewItem  item ) 
600598    { 
601599        if  ( ! item . IsAttached  ||  item . Cell  is  null )  return ; 
602600
603-         Adapter ! . OnCellRecycled ( item . Cell ! ,  item . AdapterItem ,  item . Position ) ; 
601+         Adapter ! . OnCellRecycled ( item . Cell ! ,  item . AdapterItem ! ,  item . Position ) ; 
604602
605603        CacheCell ( item ) ; 
606604    } 
@@ -614,7 +612,7 @@ protected virtual void CacheCell(VirtualizeListViewItem item)
614612        cell . TranslationX  =  CachedItemsCoords ; 
615613        cell . TranslationY  =  CachedItemsCoords ; 
616614
617-         CachedCells . Add ( ( item . Template ,  cell ) ) ; 
615+         CachedCells . Add ( ( item . Template ! ,  cell ) ) ; 
618616        item . Cell  =  null ; 
619617    } 
620618
@@ -626,7 +624,7 @@ protected virtual void ReuseCell(VirtualizeListViewItem item, bool createNewIfNo
626624            return ; 
627625        } 
628626
629-         var  freeCell  =  CachedCells . LastOrDefault ( i =>  ( i . Template  as  IDataTemplateController ) . Id  ==  ( item . Template  as  IDataTemplateController ) . Id ) ; 
627+         var  freeCell  =  CachedCells . LastOrDefault ( i =>  ( i . Template  as  IDataTemplateController ) . Id  ==  ( item . Template  as  IDataTemplateController ) ! . Id ) ; 
630628        if  ( freeCell  !=  default ) 
631629        { 
632630            CachedCells . Remove ( freeCell ) ; 
@@ -642,7 +640,7 @@ protected virtual void ReuseCell(VirtualizeListViewItem item, bool createNewIfNo
642640        else 
643641        { 
644642            var  freeItem  =  LaidOutItems . FirstOrDefault ( i => 
645-                 ( i . Template  as  IDataTemplateController ) . Id  ==  ( item . Template  as  IDataTemplateController ) . Id 
643+                 ( i . Template  as  IDataTemplateController ) ! . Id  ==  ( item . Template  as  IDataTemplateController ) ! . Id 
646644                &&  ! i . IsAttached  &&  ! i . IsOnScreen  &&  i . Cell  is  not null ) ; 
647645            if  ( freeItem  is  not null ) 
648646            { 
@@ -652,12 +650,12 @@ protected virtual void ReuseCell(VirtualizeListViewItem item, bool createNewIfNo
652650            } 
653651            else  if  ( createNewIfNoCached ) 
654652            { 
655-                 item . Cell  =  Adapter ! . OnCreateCell ( item . Template ,  item . Position ) ; 
653+                 item . Cell  =  Adapter ! . OnCreateCell ( item . Template ! ,  item . Position ) ; 
656654                this . Add ( item . Cell ) ; 
657655            } 
658656        } 
659657
660-         Adapter ! . OnBindCell ( item . Cell ! ,  item . AdapterItem ,  item . Position ) ; 
658+         Adapter ! . OnBindCell ( item . Cell ! ,  item . AdapterItem ! ,  item . Position ) ; 
661659
662660        ArrangeItem ( LaidOutItems ,  item ,  availableSpace ) ; 
663661    } 
@@ -788,7 +786,12 @@ protected virtual Size GetDesiredLayoutSize(double widthConstraint, double heigh
788786    protected  abstract  bool  AdjustScrollIfNeeded ( IReadOnlyList < VirtualizeListViewItem >  items ,  VirtualizeListViewItem  item ,  Rect  prevBoundsOfItem ) ; 
789787
790788    #region ILayoutManager
791-     public  virtual  Size  Measure ( double  widthConstraint ,  double  heightConstraint ) 
789+     Size  ILayoutManager . Measure ( double  widthConstraint ,  double  heightConstraint ) 
790+     { 
791+         return  LayoutManagerMeasure ( widthConstraint ,  heightConstraint ) ; 
792+     } 
793+ 
794+     public  virtual  Size  LayoutManagerMeasure ( double  widthConstraint ,  double  heightConstraint ) 
792795    { 
793796        var  items  =  CollectionsMarshal . AsSpan ( ( this  as  IBindableLayout ) . Children  as  List < IView > ) ; 
794797        var  length  =  items . Length ; 
0 commit comments