0

在开始之前,我不是 SL 或 WPF 大师,所以我需要一些指导。我拥有的是一个List<CustomObject>. 然后我有一个视图,我可以将“CustomObject”绑定到并显示所有数据。现在为了跟上 Metro 指南和 Navigation 指南,我希望能够使用 SL Control Toolkit Gesture Service 来检测轻弹(这部分已经完成并且正在工作)。当我向左滑动时,它会绑定当前列表位置 -1 当我向右滑动时绑定当前列表位置 + 1。

现在,我需要让它漂亮。我希望它的行为类似于枢轴控件,因为当我按住时,它将网格向左移动,当创建完整的轻弹时,它向左或向右滑动并加载下一个项目。

这些列表可以有 100 个项目,因此不能将它们动态添加到 Pivot 控件。

我知道我必须捕获 OnDelta 并开始移动网格,但我真的想找到一个与我正在寻找的样本相似的样本来给我所有的东西。曾经有一些 Pivot 和 Panorama 控件的自定义实现,但我找不到它们。

有什么想法可以将我指向正确的地方吗?

谢谢!

4

1 回答 1

1

Because you need to create multiple instances of whatever displays your CustomObject I would consider using a Pivot control with three items in it. The three items should be the current item and the ones either side of it.

As the user navigates between items update the DataContext/Binding of the other items so they reflect the itesm next to the one currently displayed. (You'll only need to set one at a time.)

I've used this technique successfully in apps where each page wasn't excessively complicated to load. (When it was there was a lag when navigating quickly between items.)

于 2011-08-16T09:09:16.487 回答