暂停/恢复ListView [英] Suspend/Restore ListView

查看:68
本文介绍了暂停/恢复ListView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

暂停时,我正在保存ListView。因此,我正在保存他的ItemsSource,SelectedIndex和Visibility。

正确吗?

While suspending, I am saving an ListView. Therefore, I am saving his ItemsSource, SelectedIndex and Visibility.
Correct?

现在恢复时它正在设置这三件事,但它仍然不是这样的良好的用户体验,因为我无法正确设置当前视图。

Now while restoring it's working to just set these 3 things, but still it's not such a good user experience as I cannot set the current view correctly.

当然,我可以使用scrollintoview将当前所选项目置于视图中,但如果没有选择项目但滚动,我无法正确重置视图。

sure, I can use scrollintoview to bring the currently selected item into view, but if there is no item selected, but scrolled, I am not able to reset the view correctly.

有任何建议吗?

谢谢

推荐答案

您可以保存项目,SelectedIndex 暂停时的可见性。

You can save the items, SelectedIndex  and Visibility when you suspend.

恢复应用程序时,应显示进度条,直到数据加载为止。

When you restore the application, you should show progress bar until the data is loaded.

类似这样的内容:

在显示列表视图之前,您应该加载数据并显示进度条。加载数据后,首先设置项目,Visibility然后选择SelectedIndex 最后是scrollintoview。并显示列表视图并隐藏进度条。

before you show the listview, you should load the data and while show a progress bar. After load the data, set first the items, the Visibility and then SelectedIndex  at the end scrollintoview. And the show the listview and hide the progress bar.


这篇关于暂停/恢复ListView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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