Longlistselector中的ItemsPanel属性控制Windows Phone 8 SDK

时间:2013-03-25 17:08:47

标签: windows-phone-8 longlistselector itemspanel

有人知道Windows Phone 8 SDK中的Longlistselector控件(不是WP 7.5的Windows Phone工具包)是否具有ItemsPanel属性或等效属性吗?

ListBox控件具有这样的属性,我用它来包装WrapPanel中的项目。

<ListBox>
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <toolkit:WrapPanel/>
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>

这里有一个答案:How to wrap ItemsPanel in LongListSelector?但这是指在WP8 SDK中的工具包中找不到的Longlistselector(我无法访问源代码以使用上述解决方案)。

有人有想法吗?

1 个答案:

答案 0 :(得分:7)

您应该可以使用LayoutMode属性来完成此操作。将值设置为Grid

  

获取或设置一个值,该值指定是否   Microsoft.Phone.Controls.LongListSelector处于列表模式或网格中   Microsoft.Phone.Controls.LongListSelectorLayoutMode中的模式   枚举。

<phone:LongListSelector ItemsSource="{Binding Items}" LayoutMode="Grid" >