@@ -112,7 +112,7 @@ internal IEnumerable<CacheEntry> CompleteGeneration(int endIndex)
112
112
if ( unexpectedUnusedEntries . count > 0 )
113
113
{
114
114
// If actually all entries have been recycled, some entries might be part of the recyclable head.
115
- unexpectedUnusedEntries . at = Math . Max ( _generationRecyclableBefore . at , _generationRecyclableAfter . at - unexpectedUnusedEntries . count ) ;
115
+ unexpectedUnusedEntries . at = Math . Max ( _generationRecyclableBefore . at + _generationRecyclableBefore . count , _generationRecyclableAfter . at - unexpectedUnusedEntries . count ) ;
116
116
unexpectedUnusedEntries . count = Math . Min ( unexpectedUnusedEntries . count , _entries . Count - unexpectedUnusedEntries . at ) ;
117
117
}
118
118
@@ -354,14 +354,19 @@ internal void DisconnectItemsHost()
354
354
internal DependencyObject ? ContainerFromIndex ( int index )
355
355
=> _cache . ContainerFromIndex ( index ) ;
356
356
357
- [ NotImplemented ]
358
- internal void ScrollItemintoView ( int index , ScrollIntoViewAlignment alignment , double offset , bool forceSynchronous )
359
- {
360
- }
361
-
362
- [ NotImplemented ]
363
357
internal void ScrollItemIntoView ( int index , ScrollIntoViewAlignment alignment , double offset , bool forceSynchronous )
364
358
{
359
+ if ( _layoutStrategy is null )
360
+ {
361
+ return ;
362
+ }
363
+
364
+ _layoutStrategy . EstimateElementBounds ( ElementType . ItemContainer , index , default , default , default , out var bounds ) ;
365
+
366
+ Owner ? . ScrollViewer ? . ChangeView (
367
+ horizontalOffset : null ,
368
+ verticalOffset : bounds . Y + offset ,
369
+ zoomFactor : null ) ;
365
370
}
366
371
367
372
private Size GetViewportSize ( )
0 commit comments