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.
我有这个故事板,其中有一个持续 3 秒的动画。它是由一个Image Tap事件触发的,但我不希望用户在它完成之前再次触发它。故事板有一个Completed事件。
Image
Tap
Completed
有没有办法可以锁定情节提要Begin并解锁Completed?
Begin
您可以将控件包装到类中,将 bool IfRunning 属性添加到该类,并在每次用户再次点击时检查它。
您的代码将与此类似:
(点击事件引发)
if(IfRunning==false) { IfRunning=true; BeginAnimation(); }
...(在 Completed 事件中加注)
EndAnimation(); IfRunning=false;