原文:WPF之ListView使用WrapPanel

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jiuzaizuotian2014/article/details/80950402

为了在ListView中显示Wrap样式的子项,需要设置ItemsPanel为WrapPanel,如下所示。此外,还要将ScrollViewer.HorizontalScrollBarVisibility设置为"Disabled",否则是不能Wrap的。

实现的代码如下所示:

<ListView ItemsSource="{Binding Source={StaticResource workCollectionView}}"
                                      ScrollViewer.HorizontalScrollBarVisibility="Disabled">

<!--没有这个不显示数据??WHY???-->

<ListView.Style>
<Style />
</ListView.Style>

<ListView.ItemTemplate>
                                <DataTemplate>
                                    <Image MaxWidth="100" Source="{Binding PicFilePath}"/>
                                </DataTemplate>
                            </ListView.ItemTemplate>
                            <ListView.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <WrapPanel IsItemsHost="True" Orientation="Horizontal"  />
                                </ItemsPanelTemplate>
                            </ListView.ItemsPanel>
                        </ListView>

WPF之ListView使用WrapPanel的更多相关文章

  1. A WPF File ListView and ComboBox

    源码下载: Download FileListView_Version_2.zip Download FileListView_Version_2_Binaries.zip Download File ...

  2. WPF,ListView设置分组

    原文:WPF,ListView设置分组 今天遇到一个问题,就是在ListView中设置分组.想了很久在网上早了些资料作出一个例子. 分组字段也可以在后台中定义: CollectionView view ...

  3. 深入探讨WPF的ListView控件

    接上一篇博客初步探讨WPF的ListView控件(涉及模板.查找子控件)  我们继续探讨ListView的用法      一.实现排序功能 需求是这样的:假如我们把学生的分数放入ListView,当我 ...

  4. (转)利用WPF的ListView进行大数据量异步加载

    原文:http://www.cnblogs.com/scy251147/archive/2012/01/08/2305319.html 由于之前利用Winform的ListView进行大数据量加载的时 ...

  5. 【C#/WPF】ListView的MVVM例子,及禁止拖动ListView的头部Header

    一个ListView的MVVM简单例子: <ListView ItemsSource="{Binding GoodsList}" Margin="0,10,0,10 ...

  6. 利用WPF的ListView进行大数据量异步加载

    原文:利用WPF的ListView进行大数据量异步加载 由于之前利用Winform的ListView进行大数据量加载的时候,诟病良多,所以今天试着用WPF的ListView来做了一下,结果没有让我失望 ...

  7. WPF 获取 ListView DataTemplate 中控件值

    原文:WPF 获取 ListView DataTemplate 中控件值 版权声明:本文为博主原创文章,未经博主允许可以随意转载 https://blog.csdn.net/songqingwei19 ...

  8. [WPF]解决ListView在没有Items时,水平滚动条不出现的问题

    转载地址:http://www.cnblogs.com/nankezhishi/archive/2010/03/19/FixListViewNotScrollHeaderBug.html 在上一篇Bl ...

  9. WPF ListBox/ListView/DataGrid 虚拟化时的滚动方式

    ListBox的滚动方式 分为像素滚动和列表项滚动 通过ListBox的附加属性ScrollViewer.CanContentScroll来设置.因此ListBox的默认模板中,含有ScrollVie ...

随机推荐

  1. Sql语法高级应用之三:存储过程

    一.存储过程概述 SQL Server中的存储过程是使用T_SQL编写的代码段.它的目的在于能够方便的从系统表中查询信息,或者完成与更新数据库表相关的管理任务和其他的系统管理任务.T_SQL语句是SQ ...

  2. 理解和配置Out of memory: Kill process

    转自:爱开源 理解 OOM killer 最近有位 VPS 客户抱怨 MySQL 无缘无故挂掉,还有位客户抱怨 VPS 经常死机,登陆到终端看了一下,都是常见的 Out of memory 问题.这通 ...

  3. 用 Core Animation 实现图片的碎片化

    用 Core Animation 实现图片的碎片化 参考书籍: 效果如下: 原理其实非常简单哦:). 1. 创建一个CALayer,使用其 contents 属性来装载一张图片(获取图片的CGImag ...

  4. [翻译] AFDropdownNotification

    AFDropdownNotification Dropdown notification view for iOS. 下拉通知的view,用于iOS. Installation - 安装 If you ...

  5. WDS使用捕获映像制作企业自定义映像

    来源:http://www.07net01.com/linux/WDSshiyongbuhuoyingxiangzhizuoqiyezidingyiyingxiang_545749_137448761 ...

  6. win8中 cmd直接以管理员权限运行

    一.组合键 WIN+X   二.锁定到任务栏,方便以后快速启动     三.控制面板->控制中心     四.更改用户账户控制设置--调到最低 好了,点击任务栏的命令提示符

  7. November 25th 2016 Week 48th Friday

    People will fall for its appearance while driving passionately. 观者倾心,驭者动魄. This is an advertisement ...

  8. P3558 [POI2013]BAJ-Bytecomputer

    题目描述 A sequence of integers is given. The bytecomputer is a device that allows the following operati ...

  9. 常用的sql语法_Row_Number

    可用来分页,也可以用来egg:获取同类型的最新的信息 ROW_NUMBER() 说明:返回结果集分区内行的序列号,每个分区的第一行从1开始.语法:ROW_NUMBER () OVER  ([ < ...

  10. django自带的登录验证功能

    django自带的验证机制 from django.shortcuts import render, redirect from django.contrib.auth import authenti ...