HOW ANIMATE POPUP ON CLOSE WILL WORK?

Lady Bird Johnson

Total Post:20

Points:140
Posted by  Lady Bird Johnson
WPF 
WPF
 1290  View(s)
Ratings:
Rate this:
Hi Developer!

So I am having trouble animating a Popup in C#, and I am wondering what I am doing wrong. The popup animates on opening, does not animate on close. Do I have to set the PopupAnimation value to a new animation after it opens? 

Popup popup = new Popup();

popup.AllowTransparency = true;

popup.StayOpen = false;

popup.PopupAnimation = PopupAnimation.Slide;

popup.IsOpen = true;

thank in advance.

  1. Pravesh Singh

    Post:412

    Points:2888
    Re: how Animate Popup on Close will work?

    To Animate a popup on close, you have to set the animation after the animation to open the popup.

    popup.Opened += popup_Opened; 

    void popup_Opened(object sender, EventArgs e)

    {

        popup.PopupAnimation = PopupAnimation.Fade;

    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!