win10 app - animating in a new item at top of list

廉价感情. 提交于 2019-12-10 18:37:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!