Creating hub page with different controls in Windows 8

匿名 (未验证) 提交于 2019-12-03 07:36:14

问题:

The most landing/hub pages you see are just a GroupedGridView ( for example the actual marketplace app )

But I would like to have a Grouped hub page with different controls.

For example my first control is a ListView that contains some categories. 2nd and 3th control are GridViews with several items in them.

If all 3 controls were GridViews I could easily get this working but it's not.

I can't seem to find a working combination of ScrollViewer with a Grid or Stackpanel to get the actual full Horizontal Scrolling working.

Any idea's or examples on how to create such a landing/hub page with different controls in one horizontal page?

回答1:

You can use an GridView that is not grouped where each item will be a different control displayed using a different DataTemplate.

Or you can trick the FlipView to behave like a Panorama control for Windows Phone. Details at http://dotnetbyexample.blogspot.cz/2012/08/a-winrt-behavior-to-turn-flipview-into.html

EDIT: For the first solution you create a base class and create a list with your different objects derived from the base class. Then you use the GridView's ItemTemplaceSelector to select a select an appropriate DataTemplate. See http://coding.kulman.sk/using-different-data-templates-with-gridview-in-windows-8-apps/



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