Easing effect when a ListBox scrolls in WPF

Source: Internet
Author: User

Text: Easing effect when a ListBox scrolls in WPF

Problems encountered at work last week:

The regular listbox is always moving and feels stiff when scrolling.

So you want to achieve the same kind of slow action in Flash, so that the listbox can be smooth when scrolling.


Modifying the animation in the template is a method, but here's a much simpler one, and WPF provides us with code of conduct that can be edited in the Itemspaneltemplate template in the ListBox, implemented as follows:


Right-click on the "Edit copy", "editing the layout of other templates", "editor", I am here because I have edited it, so the "edit current Template" item will be available.

When you click OK, the look on the left appears.


In the panel, select Behavior, Fluidmovebehavior, and drag this behavior onto the StackPanel panel.

Finally, on the right side of the Properties window, put the "AppliesTo" Item and select "Children". Now that you're running, your listbox is much smoother in scrolling.


PS: You can also set other animation properties here.


Easing effect when a ListBox scrolls in WPF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.