All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

TreeViewControl.CustomScrollAnimation Event

Allows you to create a custom animation when TreeViewControl data is vertically scrolled (per-pixel).

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v20.2.dll

Declaration

public event TreeViewCustomScrollAnimationEventHandler CustomScrollAnimation
Public Event CustomScrollAnimation As TreeViewCustomScrollAnimationEventHandler

Event Data

The CustomScrollAnimation event's data class is DevExpress.Xpf.Grid.TreeList.TreeViewCustomScrollAnimationEventArgs.

Remarks

To create a custom animation for per-pixel scrolling, set the AllowScrollAnimation property to true and the ScrollAnimationMode property to Custom.

Example

The following images demonstrate the difference between the default scroll animation and the scroll animation created in the code sample below.

DefaultScrollAnimation CustomScrollAnimation

<dxg:TreeViewControl ...
                     x:Name="treeview"
                     AllowScrollAnimation="True"
                     ScrollAnimationMode="Custom"
                     CustomScrollAnimation="treeview_CustomScrollAnimation"/>
using System.Windows.Media.Animation;

void treeview_CustomScrollAnimation(object sender, DevExpress.Xpf.Grid.TreeList.TreeViewCustomScrollAnimationEventArgs e) {
    e.Storyboard = new Storyboard();
    DoubleAnimation animation = new DoubleAnimation();
    animation.From = e.OldOffset;
    animation.To = e.NewOffset;
    animation.Duration = new Duration(TimeSpan.FromMilliseconds(600));
    animation.EasingFunction = new ExponentialEase() { Exponent = 0 };
    e.Storyboard.Children.Add(animation);
}
See Also