views:

54

answers:

1

http://stackoverflow.com/questions/2455963/wpf-mvvm-dynamic-animation-using-storyboards

There is a question i have found that relates directly to the issue I am having. The answer provided in that thread is a bit short, however. I did a little looking on google for 'attached properties' and i still remain a bit confused.

Could someone shed a little light regarding this question? Perhaps provide a little sample code for the link stated above?

Thanks in advance

A: 

Attached properties are properties from a container that exist in the children. For example, it allows you to set the column and row of a UIElement in a grid:

<Grid>
...
<Button Grid.Row="1">Push Me!</Button>
</Grid>

The Grid.Row is the attached property and is accessible to the button even though Button doesn't itself define the Grid.Row.

Whether it's animations or what have you, that's what the attached properties do. In the link you'll notice references to Canvas.Top and so on and what that's doing is telling the object for which you are adding the Canvas.Top property that you want it to have a certain place in the parent container.

Christopher Estep
Well thanks for the insight. Could you provide a little more information regarding the link I posted? Pretty much, how would I use this information you gave me to solve the question in the Link? The Link attempts to bind their 'To' property of the animation, and I'm still fumbling on that part.
Peanut