WPF ,listbox,平滑滚动的2种方式。
生活随笔
收集整理的這篇文章主要介紹了
WPF ,listbox,平滑滚动的2种方式。
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
一,烤地瓜版本的。。? 這個(gè)版本不安裝內(nèi)容滾動,,鼠標(biāo)滑輪滾動一次距離相同,
? 具體步驟參照他的博客,說點(diǎn)注意的,,
1,ScrollViewer.CanContentScroll="False"
2,容器模版虛擬化StackPanel換成非虛擬的。
<ItemsPanelTemplate x:Key="ItemsPanelTemplate1"><StackPanel IsItemsHost="True"/></ItemsPanelTemplate>二,安裝內(nèi)容滾動,,滑輪滾動一次,listbox移動3項(xiàng),體驗(yàn)沒有一的好。。。ScrollViewer.CanContentScroll="True"
<ItemsPanelTemplate x:Key="ItemsPanelTemplate1"><VirtualizingStackPanel IsItemsHost="True"><i:Interaction.Behaviors><ei:FluidMoveBehavior AppliesTo="Children"/></i:Interaction.Behaviors></VirtualizingStackPanel></ItemsPanelTemplate>很簡單的效果,,,下載Demo
轉(zhuǎn)載于:https://www.cnblogs.com/m7777/p/4701158.html
總結(jié)
以上是生活随笔為你收集整理的WPF ,listbox,平滑滚动的2种方式。的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 变态最大值--nyoj题目811
- 下一篇: (C#)设计模式之装饰模式