WPF:带有图标视图的 ListView? [英] WPF: ListView with icons view?
问题描述
我不知道如何在 WPF ListView(类似于 Windows 资源管理器的视图)中实现图标视图.在谷歌上搜索我只找到了关于实现 GridView 的信息,但没有找到关于 Icon View 的线索.我不是在谈论 System.Windows.Form.ListView
而是 System.Windows.Controls.ListView
.
I can't figure out how I can implement an Icon View in the WPF ListView (a view similar to the Windows Explorer). Searching on google I only found informations about implementing the GridView but no clues about the Icon View. I'm not talking about System.Windows.Form.ListView
but System.Windows.Controls.ListView
.
也许还有另一个控件可以做到这一点?我没有找到任何与此相关的内容?
Perhaps there is another control to do that? I didn't find anything relevant about this?
我只发现一些人使用列表框手动构建图标视图并更改面板模板和图标模板.我不敢相信这是唯一的方法.
I've only found some people that build the icon view by hand using the listbox and changing the paneltemplate and the icontemplate. I can't believe this is the only way to do it.
有什么线索吗?
提前致谢
推荐答案
与 Tanveer Badar 的回答相同,但使用 WrapPanel 而不是 UniformGrid.在列表框中设置以下内容:
Same as Tanveer Badar's answer, but with a WrapPanel instead of a UniformGrid. Set the following in your listbox:
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
强制 WrapPanel 换行.
to force the WrapPanel to wrap.
这篇关于WPF:带有图标视图的 ListView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!