Set Animation for opening and closing a RadPan.

1 Answer 129 Views
DragAndDrop PanelBar Styling TabbedWindow TransitionControl
alireza
Top achievements
Rank 1
alireza asked on 12 Dec 2021, 10:37 AM

Hi, I have the following code and I want to have an animation to enable and disable any "radpane "in the related "radpanegroup".

For example, when I put a "radpane" in pin mode, its width increases by 3 seconds, or another example is that the border color changes.
My solution is to use: 

<telerik:RadDocking>

        ...

...

...

<telerik:RadDocking.FlyoutBehavior>
                <local:AnimatedFlyoutBehavior/>
            </telerik:RadDocking.FlyoutBehavior>

</telerik:RadDocking>

 

I used the IFlyoutBehavior interface and as a result the following functions were implemented:

  void IFlyoutBehavior.OnMouseEnter (IFlyoutHost host, RadPane targetPane)
        {

        }

        void IFlyoutBehavior.OnPaneActivated (IFlyoutHost host, RadPane targetPane)
{
        }

        void IFlyoutBehavior.OnMouseLeave (IFlyoutHost host)
        {

        }

        void IFlyoutBehavior.OnOpeningTimerTimeout (IFlyoutHost host)
        {


        }

        void IFlyoutBehavior.OnClosingTimerTimeout (IFlyoutHost host)
        {

        }

        void IFlyoutBehavior.OnPaneDeactivated (IFlyoutHost host, RadPane targetPane)
        {
            var selectedPane = host.SelectedPane;

            if (selectedPane! = null &&! selectedPane.IsActive && host.CurrentState == FlyoutState.Opened)
            {
                host.StartCloseAnimation ();
            }
        }

        void IFlyoutBehavior.OnPaneMouseLeftButtonDown (IFlyoutHost host, RadPane targetPane)
        {
            if (host.CurrentState! = FlyoutState.Opened)
            {
                host.StartOpenAnimation ();
            }
            else
            {
                host.StartCloseAnimation ();

            }
        }

    }

I could not use enough of this interface. Is there a better way to customize animation in radpane or to develop it that way?

 

 

                     

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 15 Dec 2021, 02:06 PM

Hi alireza,

I want to start by clarifying that the FlyoutBehavior is used only in the auto-hide area of the RadDocking control. Can you please specify whether you want the animations to only occur there or in other areas as well?

If you only want the animations in the auto-hide area, you can override the default animations by setting the attached AnimationManager.AnimationSelector property. I've prepared a small sample project to demonstrate how you can achieve this with the default animations, but you can also create custom animations to fit your requirement.

If you require animations in other areas of the control, this will not be straightforward, however, a similar discussion can be found in the following forum thread: How to animate adding or activating a RadPane.

I hope you find this information helpful.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DragAndDrop PanelBar Styling TabbedWindow TransitionControl
Asked by
alireza
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or