这是我的代码(假设我们在页面上有一个启动弹出窗口的按钮):
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;
}
弹出窗口只显示没有动画,即使我设置了PopupAnimation属性..有谁知道为什么?