所以我在使用C#设置Popup时遇到了麻烦,我想知道我做错了什么。弹出窗口在打开时动画,在关闭时不动画。打开后,是否必须将PopupAnimation值设置为新动画?
Popup popup = new Popup();
popup.AllowTransparency = true;
popup.StayOpen = false;
popup.PopupAnimation = PopupAnimation.Slide;
popup.IsOpen = true;
答案 0 :(得分:0)
要在关闭时为弹出窗口设置动画,您必须在动画后设置动画以打开弹出窗口。
popup.Opened += popup_Opened;
void popup_Opened(object sender, EventArgs e)
{
popup.PopupAnimation = PopupAnimation.Fade;
}