WP 8.1自下而上无限滚动 [英] WP 8.1 bottom to top infinite scrolling

查看:121
本文介绍了WP 8.1自下而上无限滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经探索<一个href=\"https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.data.isupportincrementalloading(v=win.10).aspx\"相对=nofollow> ISupportIncrementalLoading ,看到 MS样品和<一个href=\"https://marcominerva.word$p$pss.com/2013/05/22/implementing-the-isupportincrementalloading-interface-in-a-window-store-app/\"相对=nofollow>其他范例为无限滚动的行为。

I have explored ISupportIncrementalLoading and seen MS sample and other examples for infinite scrolling behaviour.

但我想下到上滚动,其中物品在上面添加上滚动下到上。

But I want bottom to top scrolling where items are added on top on scrolling bottom to top.

编辑:我已经找到了解决方法这一点。我已经通过180度180度和DataTemplate的这帮助我实现预期的功能列表视图旋转

I have found a workaround for this. I have rotated listview by 180 degree and datatemplate by 180 degree which helped me achieve desired functionality.

 <ListView x:Name="GridViewMain" IncrementalLoadingThreshold="2" RenderTransformOrigin="0.5,0.5">
        <ListView.RenderTransform>
            <RotateTransform Angle="180"></RotateTransform>
        </ListView.RenderTransform>
        <ListView.ItemContainerStyle>
            <Style TargetType="ListViewItem">
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            </Style>
        </ListView.ItemContainerStyle>
        <ListView.Resources>
            <DataTemplate x:Key="DataTemplateGridViewMain">
                <Grid HorizontalAlignment="Stretch" Background="#FF7C1A9B" RenderTransformOrigin="0.5,0.5">
                    <Grid.RenderTransform>
                        <RotateTransform Angle="180"/>
                    </Grid.RenderTransform>
                    <TextBlock HorizontalAlignment="Left" Text="{Binding}" VerticalAlignment="Center" FontSize="20" FontFamily="Tempus Sans ITC" />
                </Grid>
            </DataTemplate>
        </ListView.Resources>
        <ListView.ItemTemplate>
            <StaticResource ResourceKey="DataTemplateGridViewMain" />
        </ListView.ItemTemplate>
    </ListView>

这是解决方案有任何影响PERF的或者有任何替代办法做到这一点?

Is this solution has any perf impact or is there any alternate way to do this?

推荐答案

不知道这是否会满足您的需要,但我不得不创建一个聊天对话画面时做同样的事情,并能够实现这一目标用ExtendedListView:< A HREF =htt​​ps://www.nuget.org/packages/ExtendedListView相对=nofollow> https://www.nuget.org/packages/ExtendedListView

not sure if this will fit your needs, but I had to do something similar when creating a chat conversation screen, and was able to achieve this using ExtendedListView: https://www.nuget.org/packages/ExtendedListView

我们加载最新的项目,并使用ScrollIntoView(lastMessage)光标在底部位置。通常你会使用MoreDataRequested事件获得的物品时,滚动的底部,而是我们扭转它,并用PullToRefreshRequested模拟滚动顶端,改变了装载模板说加载更多的消息。

We load the most recent items, and use ScrollIntoView(lastMessage) to position the cursor at the bottom. Normally you would use MoreDataRequested event to get items when it scrolls to the bottom, but instead we reversed it and used the PullToRefreshRequested to simulate scrolling to the top, changing the loading template to say "loading more messages".

工程pretty很适合我们,我希望这是有帮助的!

works pretty well for us, I hope this is helpful!

这篇关于WP 8.1自下而上无限滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆