Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 ListView 中显示项目列表,但如果有的话,也按类别对它们进行分组,否则将它们显示在根目录中。
这就是我想要实现的目标。
CollectionViewSource 似乎不支持这种行为,因为添加 PropertyGroupDescription 将简单地显示带有组的数据(并忽略其余部分)。
The "ungrouped" data is still a group - so to achieve that behaviour I would create a ContainerStyleSelector on your groupstyle to display the last items in a stackpanel instead of an expander.