[UWP]如何在分组列表视图中使用不同的面板? [英] [UWP]How to use different panels in a grouped list view?
问题描述
我需要为ListView中的特定部分/组使用不同的面板。我该怎么做(使用XAML,C#或其他任何东西)?我已经尝试过使用 GroupedStyleSelector
但
它不起作用(我研究了它但事实证明它不是为此目的而设计)。这是我现在的XAML:
< ListView ItemsSource = " {Binding Source = {StaticResource cvs}}" >
< ListView.GroupStyle>
< GroupStyle HidesIfEmpty = " True" >
< GroupStyle.Panel>
< ItemsPanelTemplate>
//我想为特定组更改此项
< uwp:SGStaggeredPanel />
< / ItemsPanelTemplate>
< /GroupStyle.Panel>
< / GroupStyle>
< /ListView.GroupStyle>
< / ListView>
我正在考虑对子面板进行子类化,但问题是如何获得对当前组的引用?
我找到了一种方法,但我需要对此进行一些测试。可能会有一些时间延迟。
祝你好运,
罗伊
I need to use a different panel for a particular section/group in my ListView. How do I do that (using XAML, C#, or anything)? I already tried using GroupedStyleSelector
but
it didn't work (I researched about it but it turned out it's not designed for this purpose). Here's my XAML right now:
<ListView ItemsSource="{Binding Source={StaticResource cvs}}">
<ListView.GroupStyle>
<GroupStyle HidesIfEmpty="True">
<GroupStyle.Panel>
<ItemsPanelTemplate>
// I want to change this for a particular group
<uwp:SGStaggeredPanel/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
</GroupStyle>
</ListView.GroupStyle>
</ListView>
I'm thinking of subclassing the panel, but the problem is how do I get a reference to the current group?
Hi,
I found a way but I need some test for this. There might be some time delay.
Best regards,
Roy
这篇关于[UWP]如何在分组列表视图中使用不同的面板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!