Konrad Reiche
Konrad Reiche

Reputation: 29493

PropertyPath to TransformGroup Children in WPF

I am animating two RenderTransforms of elements in a programmatic way in C# by doing the following:

Storyboard.SetTargetProperty(shiftAnimation, new PropertyPath("RenderTransform.X"));

The problem is, now where I use two transforms, I needed to add a TransformGroup. But I cannot figure out how the path is accessed with it.

TransformGroup.RenderTransform.X or anything similar does not work.

Upvotes: 1

Views: 2324

Answers (1)

Konrad Reiche
Konrad Reiche

Reputation: 29493

One way would be:

new PropertyPath("RenderTransform.Children[0].X");

and

new PropertyPath("RenderTransform.Children[1].ScaleX");

Though this is kinda static with the hard coded index

Upvotes: 5

Related Questions