问题
I'm making a news feed app, which periodically adds new content to the top of the list. When I check for new items, there might be dozens or just one. What I'd like is for the oldest of the new items to peek into view so they can continue scrolling up for newer stories.
Sadly this doesn't come for free with the platform. However whats interesting is that it does come for free at the bottom of the list. If you add items to the bottom of the list they peek in properly with a nice animation. If you add items to the top of the list they just blink into place.
Workarounds available? I'm feeling this is more of a platform bug - I'm setting KeepItemsInView but if I'm at the top of the list it doesn't keep the item I'm looking at in view.
Repro video: http://1drv.ms/1PP8AZz
Full source: http://1drv.ms/1PP8FfT
<ListView Grid.Row="1" ItemsSource="{x:Bind Items}" Padding="0,100,0,100">
<ListView.ItemTemplate>
<DataTemplate >
<Grid Margin="10">
<Image Source="{Binding}"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel Orientation="Vertical" ItemsUpdatingScrollMode="KeepItemsInView" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
来源:https://stackoverflow.com/questions/30292690/win10-app-animating-in-a-new-item-at-top-of-list