WPF ,listbox,平滑滚动的2种方式。

时间:2015-08-04 10:48:42   收藏:0   阅读:1777

一,烤地瓜版本的。。  这个版本不安装内容滚动,,鼠标滑轮滚动一次距离相同,

  具体步骤参照他的博客,说点注意的,,

1,ScrollViewer.CanContentScroll="False"

2,容器模版虚拟化StackPanel换成非虚拟的。

<ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
			<StackPanel IsItemsHost="True"/>
		</ItemsPanelTemplate>

  二,安装内容滚动,,滑轮滚动一次,listbox移动3项,体验没有一的好。。。ScrollViewer.CanContentScroll="True"

 <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
            <VirtualizingStackPanel IsItemsHost="True">
                <i:Interaction.Behaviors>
                    <ei:FluidMoveBehavior AppliesTo="Children"/>
                </i:Interaction.Behaviors>
            </VirtualizingStackPanel>
        </ItemsPanelTemplate>

   很简单的效果,,,下载Demo

原文:http://www.cnblogs.com/m7777/p/4701158.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!