2011-03-23 51 views
0

我做在C#中的動畫元素的兩個RenderTransforms以編程的方式如下:的PropertyPath到的TransformGroup兒童WPF

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

的問題是,現在,我用兩個轉換,我需要添加一個的TransformGroup。但我無法弄清楚如何使用它訪問路徑。

TransformGroup.RenderTransform.X或類似的東西不起作用。

回答

2

一種方法是:

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

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

雖然這是硬編碼的指數

有點靜