TreeListView.ScrollAnimationMode Property
Gets or sets the per-pixel scrolling mode. This is a dependency property.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v24.2.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
Property Value
Type | Description |
---|---|
ScrollAnimationMode | A ScrollAnimationMode enumeration value that specifies the per-pexel scrolling mode. |
Available values:
Name | Description |
---|---|
EaseOut | Starts quickly and then decelerates. |
Linear | Moves smoothly. |
EaseInOut | Starts slowly, accelerates and then decelerates. |
Custom | A custom animation effect implemented within the TableView.CustomScrollAnimation event handler (TreeListView.CustomScrollAnimation in TreeListView). |
Remarks
To provide a visual effect for per-pixel scrolling, set the TreeListView.AllowScrollAnimation property to true. The ScrollAnimationMode and TreeListView.ScrollAnimationDuration properties allow you to customize the animation. The first property specifies the scrolling mode, the second property specifies the animation length.
Example
This example shows how to implement a custom animation displayed when a user vertically scrolls the GridControl (per-pixel scrolling):
- Set the TableView.AllowScrollAnimation property to
true
. - Set the TableView.ScrollAnimationMode property to
Custom
. - Handle the TableView.CustomScrollAnimation event and specify a custom scroll animation.
<dxg:GridControl Name="grid" AutoGenerateColumns="AddNew">
<dxg:GridControl.View>
<dxg:TableView Name="view"
AutoWidth="True"
AllowScrollAnimation="True"
ScrollAnimationMode="Custom"
CustomScrollAnimation="view_CustomScrollAnimation"/>
</dxg:GridControl.View>
</dxg:GridControl>
void view_CustomScrollAnimation(object sender, DevExpress.Xpf.Grid.CustomScrollAnimationEventArgs e) {
e.Storyboard = new Storyboard();
DoubleAnimation animation = new DoubleAnimation {
From = e.OldOffset,
To = e.NewOffset,
Duration = new Duration(TimeSpan.FromMilliseconds(600)),
EasingFunction = new ExponentialEase() { Exponent = 0 }
};
e.Storyboard.Children.Add(animation);
}