在水平垂直的ListView的ListView [英] Vertical ListView in Horizontal ListView

查看:216
本文介绍了在水平垂直的ListView的ListView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是获得在WPF这样的结果,最好的办法?
为了使嵌入每一个ListViewItem垂直列表视图在一个水平列表视图?

What's the best approach to get such a result in WPF? To embedd a vertical listview per listviewitem in a horizontal listview?

感谢您的努力。

推荐答案

有关外的ListView 设置 ItemsPanelTemplate VirtualizingStackPanel 与方向设置为横向

For outer ListView set ItemsPanelTemplate to be VirtualizingStackPanel with orientation set to Horizontal.

有关内部ListView控件,设置的ItemTemplate 为ListView控件。

For inner listView, set ItemTemplate as ListView.

    <ListView>
        <ListView.ItemsPanel>
            <ItemsPanelTemplate>
                <VirtualizingStackPanel Orientation="Horizontal"/>
            </ItemsPanelTemplate>
        </ListView.ItemsPanel>
        <ListView.ItemTemplate>
            <DataTemplate>
                <ListView/>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

当然,你必须调整为内部的ListView按您的需求有点模板。

Of course you have to tweak a bit template for inner listView as per your needs.

这篇关于在水平垂直的ListView的ListView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆