ciao
Ho un problema
Ho creato una storyboard il cui codice è
// <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="img_castello" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
// <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
// <EasingDoubleKeyFrame KeyTime="00:00:00.0530000" Value="4"/>
// <EasingDoubleKeyFrame KeyTime="00:00:00.1270000" Value="-4"/>
// <EasingDoubleKeyFrame KeyTime="00:00:00.1970000" Value="1.985"/>
// <EasingDoubleKeyFrame KeyTime="00:00:00.3820000" Value="15.03"/>
// </DoubleAnimationUsingKeyFrames>
Vorrei creare da codeBehind questa animazione e mi muovo così
Storyboard storyboard1 = new Storyboard();
DoubleAnimationUsingKeyFrames DoubleAnimationUsingKeyFrames1 = new DoubleAnimationUsingKeyFrames();
DoubleAnimationUsingKeyFrames1.BeginTime = new TimeSpan(0, 0, 0);
EasingDoubleKeyFrame EasingDoubleKeyFrame1_1 = new EasingDoubleKeyFrame();
EasingDoubleKeyFrame1_1.KeyTime = new TimeSpan(0, 0, 0);
EasingDoubleKeyFrame1_1.Value = 0;
EasingDoubleKeyFrame EasingDoubleKeyFrame1_2 = new EasingDoubleKeyFrame();
EasingDoubleKeyFrame1_2.KeyTime = new TimeSpan(0, 0, 0, 0530000);
EasingDoubleKeyFrame1_2.Value = 4;
EasingDoubleKeyFrame EasingDoubleKeyFrame1_3 = new EasingDoubleKeyFrame();
EasingDoubleKeyFrame1_3.KeyTime = new TimeSpan(0, 0, 0, 1270000);
EasingDoubleKeyFrame1_3.Value = -4;
EasingDoubleKeyFrame EasingDoubleKeyFrame1_4 = new EasingDoubleKeyFrame();
EasingDoubleKeyFrame1_4.KeyTime = new TimeSpan(0, 0, 0, 1970000);
EasingDoubleKeyFrame1_4.Value = 1.985;
EasingDoubleKeyFrame EasingDoubleKeyFrame1_5 = new EasingDoubleKeyFrame();
EasingDoubleKeyFrame1_5.KeyTime = new TimeSpan(0, 0, 0, 3820000);
EasingDoubleKeyFrame1_5.Value = 15.03;
DoubleAnimationUsingKeyFrames1.KeyFrames.Add(EasingDoubleKeyFrame1_1);
DoubleAnimationUsingKeyFrames1.KeyFrames.Add(EasingDoubleKeyFrame1_2);
DoubleAnimationUsingKeyFrames1.KeyFrames.Add(EasingDoubleKeyFrame1_3);
DoubleAnimationUsingKeyFrames1.KeyFrames.Add(EasingDoubleKeyFrame1_4);
DoubleAnimationUsingKeyFrames1.KeyFrames.Add(EasingDoubleKeyFrame1_5);
Storyboard.SetTarget(DoubleAnimationUsingKeyFrames1, img);
Storyboard.SetTargetProperty(DoubleAnimationUsingKeyFrames1, new PropertyPath( "Qui non sono riuscito a trovare la sintassi giusta" );
Qual'è la sintassi giusta di (UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)
nel properypath?