我有一个普通的GridView,它显示分组数据.我的目标是将标题(按钮)从组顶部移动到组的左侧.
<GridView>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<GridView.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<Grid>
<Button Content="{Binding Title}"/>
</Grid>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<VariableSizedWrapGrid ItemWidth="240" ItemHeight="160" Orientation="Vertical" Margin="0,0,80,0"/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
</GroupStyle>
</GridView.GroupStyle>
<GridView.ItemTemplate>
<!-- item template -->
</GridView.ItemTemplate>
</GridView>
Run Code Online (Sandbox Code Playgroud)
这个问题的答案在Windows 8 Metro App中对GridView进行分组 - 虽然不是完全相同的所需布局 - 但如果不添加额外的"虚拟磁贴",则无法实现所需的布局.
我想知道是否有可能实现我的目标 - 将标题从组的顶部移动到组的左侧 - 没有这样一个额外的"虚拟磁贴".