How to wait for state changing transition to finish in Silverlight 4?

前端 未结 3 2093
花落未央
花落未央 2021-02-19 18:22

I need to change state of a control and then do some action. To be specific, I want to run an animation before a control is hidden. I would like to do something like that:

3条回答
  •  我在风中等你
    2021-02-19 18:54

    The correct way of handling this issue would be listening to CurrentStateChanged event on VisualStateGroup, but from my experience it is not reliable at best and broken at worst.

    Second option is to hook Completed event on your Storyboard, but this option got pitfalls of its own. In some cases visual state manager generates animations internally, so Completed event you set will not get called.

提交回复
热议问题