开发者

Stopping a TranslateTransform when the checkbox is unchecked

开发者 https://www.devze.com 2023-01-14 02:50 出处:网络
I have a translation transformation in C# WPF that starts when a checkbox is ticked,开发者_Python百科 and I would like it to stop when you uncheck the checkbox, naturally. How do I do this?

I have a translation transformation in C# WPF that starts when a checkbox is ticked,开发者_Python百科 and I would like it to stop when you uncheck the checkbox, naturally. How do I do this?

Thx


I'm guessing that you have an animation contained in a Storyboard that animates properties of the TranslateTransform? In that case you have two methods on the Storyboard: Begin and Stop.

In this case the simplest solution to your problem is to call either Storyboard.Begin or Storyboard.Stop in the Checkbox.Clicked event handler.

0

精彩评论

暂无评论...
验证码 换一张
取 消