Question : Width animation of grid

Hi to all,

I want to be able to animate the width of a gridview using code. I can't find a sample online and was wondering if someone could help me with some sample code. I found some double animation online, but don't know how to apply that to the grid I want to animate.

Thanks to all

Answer : Width animation of grid

Thanks to both for your answers. It helped me get to my solution in the end. In this cenario I HAD to do it with code because I did not kno9 what the size of my Root Grid was going to be and I was "Growing" the grid in question to the size of the Root Grid.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
Dim ActualWidth As Double = LayoutRoot.ActualWidth
Dim ActualHeight As Double = LayoutRoot.ActualHeight
 
Dim duration As Duration = New Duration(TimeSpan.FromSeconds(1.25))
' Create two DoubleAnimations and set their properties.
Dim myDoubleAnimation1 As DoubleAnimation = New DoubleAnimation
Dim myDoubleAnimation2 As DoubleAnimation = New DoubleAnimation
myDoubleAnimation1.Duration = duration
myDoubleAnimation2.Duration = duration
Dim sb As Storyboard = New Storyboard
sb.Duration = duration
sb.Children.Add(myDoubleAnimation1)
sb.Children.Add(myDoubleAnimation2)
Storyboard.SetTarget(myDoubleAnimation1, BigImageGrid)
Storyboard.SetTarget(myDoubleAnimation2, BigImageGrid)
' Set the attached properties of Canvas.Left and Canvas.Top
' to be the target properties of the two respective DoubleAnimations
Storyboard.SetTargetProperty(myDoubleAnimation1, New PropertyPath("(Grid.Height)"))
Storyboard.SetTargetProperty(myDoubleAnimation2, New PropertyPath("(Grid.Width)"))
myDoubleAnimation1.To = ActualHeight
myDoubleAnimation2.To = ActualWidth
' Begin the animation.
sb.Begin()
Random Solutions  
 
programming4us programming4us