Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我在 C# 中为弹出窗口设置动画时遇到了麻烦,我想知道我做错了什么。弹出窗口在打开时动画,在关闭时不动画。打开后是否必须将 PopupAnimation 值设置为新动画?
Popup popup = new Popup(); popup.AllowTransparency = true; popup.StayOpen = false; popup.PopupAnimation = PopupAnimation.Slide; popup.IsOpen = true;
要在关闭时为弹出窗口设置动画,您必须在动画之后设置动画才能打开弹出窗口。
popup.Opened += popup_Opened; void popup_Opened(object sender, EventArgs e) { popup.PopupAnimation = PopupAnimation.Fade; }