Boman

Hi all

How would this look in code C# or VB

I would like to use this kind of code to animate a listbox item .. but i need the Value to be dynamic or somehow set it

to different positions

Any suggestions

/Bo

----------------------

The xaml code that does what I need , just dont know how to make the value dynamic

<Storyboard x:Key="Timeline1">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="button" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="2"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="button" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
<SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="2"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>



Re: Windows Presentation Foundation (WPF) Xaml animation to code behind or done dynamic

WPCoder

Like this (see MSDN docs for specifics):

Code Snippet

DoubleAnimationUsingKeyFrames dbl = new DoubleAnimationKeyFrames();

Storyboard.SetTargetName(dbl, "button");

Storyboard.SetTargetProperty(dbl, new PropertyPath("..."));

dbl.KeyFrames.Add(new SplineDoubleKeyFrame(... look at MSDN for constructor docs -- you'll put your value "2" here)) ...