WPF下实现listview大图标效果

本文提供了一个使用XAML编写的示例代码,展示了如何在一个ScrollViewer中通过WrapPanel布局多个固定大小的图片元素,并使图片数量可以随容器宽度变化而自动换行。

  
1 < ScrollViewer Height = " 135 " HorizontalAlignment = " Center " Name = " scrollViewer1 " VerticalAlignment = " Center " Width = " 221 " HorizontalScrollBarVisibility = " Hidden " VerticalScrollBarVisibility = " Auto " Margin = " 304,242,253,184 " >
2 < WrapPanel Name = " wrapPanel " Width = " {Binding ElementName=scrollViewer1, Path=Width, Mode=OneWay} " >
3 < Image Height = " 50 " Name = " image1 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/-.png " />
4 < Image Height = " 50 " Name = " image2 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/+.png " />
5 < Image Height = " 50 " Name = " image3 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/hand.png " />
6 < Image Height = " 50 " Name = " image4 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/mouse.png " />
7 < Image Height = " 50 " Name = " image5 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/-.png " />
8 < Image Height = " 50 " Name = " image6 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/+.png " />
9 < Image Height = " 50 " Name = " image7 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/hand.png " />
10 < Image Height = " 50 " Name = " image8 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/mouse.png " />
11 < Image Height = " 50 " Name = " image9 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/-.png " />
12 < Image Height = " 50 " Name = " image10 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/+.png " />
13 < Image Height = " 50 " Name = " image11 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/hand.png " />
14 < Image Height = " 50 " Name = " image12 " Stretch = " Fill " Width = " 50 " Source = " /ImageMarker;component/Images/mouse.png " />
15 </ WrapPanel >
16 </ ScrollViewer >
作者:pksniq 发表于2011-4-13 14:54:00 原文链接
阅读:78 评论:0 查看评论

转载于:https://www.cnblogs.com/pksniq/archive/2011/04/13/2102934.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值