Ask Your Question
2

What is the method to apply a single animation to multiple controls in Silverlight?

asked 2021-12-03 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-02-17 15:00:00 +0000

bukephalos gravatar image

One method to apply a single animation to multiple controls in Silverlight is to use the "Storyboard.TargetName" property in XAML. This property allows you to specify multiple control names, separated by commas, as the targets for the same animation. For example:

<storyboard x:name="myStoryboard"> <doubleanimation from="0" to="1" duration="0:0:1" storyboard.targetname="myControl1, myControl2, myControl3" storyboard.targetproperty="Opacity"/> </storyboard>

In this example, the "myStoryboard" animation will change the opacity of the controls named "myControl1", "myControl2", and "myControl3" from 0 to 1 over one second.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-12-03 11:00:00 +0000

Seen: 7 times

Last updated: Feb 17 '22