Here is my code (Say we have a single button on the page that initiates the popup):
private void button1_Click(object sender, RoutedEventArgs e)
{
Rectangle rect = new Rectangle();
rect.Width = 50;
rect.Height = 50;
Popup mypop = new Popup();
mypop.Child = rect; // just to put something inside the popup for now
mypop.PopupAnimation = PopupAnimation.Slide;
mypop.StaysOpen = false;
mypop.PlacementTarget = button1; // open next to the button
mypop.IsOpen = true;
}
The popup just appears without animating, even though I set the PopupAnimation property.. anyone know why?
See this: Popup class: