I have a grid with elements in it. I want to move all of these elements, so you canβt just move the grid together? This does not affect what I see, and I tried even ScaleX and so well.
<Grid x:Name="HancockDetails" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Grid.Column="1" RenderTransformOrigin="0.5,0.5"> <Rectangle HorizontalAlignment="Left" Height="100" Stroke="Black" VerticalAlignment="Top" Width="100"/> <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Foreground="#FFF30000"/> </Grid> </Grid> </s:ScatterViewItem>
My function:
Storyboard sb = new Storyboard(); DoubleAnimation slide = new DoubleAnimation(); slide.To = 3000.0; slide.From = 0; slide.Duration = new Duration(TimeSpan.FromMilliseconds(40.0)); // Set the target of the animation Storyboard.SetTarget(slide,HancockDetails); Storyboard.SetTargetProperty(slide, new PropertyPath("RenderTransform.(ScaleTransform.ScaleY)")); // Kick the animation off sb.Children.Add(slide); sb.Begin();
source share