Customize the Open/Close Animations of the NavigationPane
RadNavigationView provides built in animations for opening and closing the NavigationPane. This article will demonstrate how you can customize these animations.
RadNavigationView Animations
By default RadNavigationView defines three animations named ResizePaneAnimation, MinimalPaneOpenAnimation and MinimalPaneCloseAnimation. Example 1 demonstrates the default values of these animations.
- ResizePaneAnimation: Played when the DisplayMode of the RadNavigationView is either Compact or Expanded and the NavigationPane is opened or closed.
- MinimalPaneOpenAnimation: Played when the DisplayMode of the RadNavigationView is Minimal and the NavigationPane is closed.
- MinimalPaneCloseAnimation: Played when the DisplayMode of the RadNavigationView is Minimal and the NavigationPane is opened.
Example 1: RadNavigationView Animations Default Values
Customizing Animations
In order to customize the animations supported by RadNavigationView, you can extract its style and modify it. This way you can customize the duration of the animations, change their easing function or replace the animation with a different one. Example 2 demonstrates how you can change the duration of the ResizePaneAnimation from 0.2 seconds to 3 seconds.
Example 2: Changing the duration of the ResizePaneAnimation
Figure 1: Result from Example 2 in the Office2016 theme
In order for the animations to be played correctly the AnimationName and TargetElementName properties should not be modified.
The animation namespace used in Example 2 corresponds to the following: xmlns:animation="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls".