Note that there are some explanatory texts on larger screens.

plurals
  1. POmultiple animations at the same time in windows phone
    primarykey
    data
    text
    <p>In my windows phone 7.1 application I am trying to give my user some feedback they tapped a stackpanel by rotating it. I am doing this by handling the tap event of the StackPanel and create a StoryBoard etc from there. See my code :</p> <pre><code> private void StackPanelTap(object sender, System.Windows.Input.GestureEventArgs e) { var stackPanel = ((StackPanel) sender); var renderTransform = new RotateTransform {Angle = 0,CenterX = 22.5,CenterY = 22.5}; stackPanel.RenderTransform = renderTransform; TimeSpan duration = TimeSpan.FromSeconds(0.30); var angleAnimation = new DoubleAnimation { From = 0, To = 360, Duration = duration, AutoReverse = false }; Storyboard.SetTargetProperty(angleAnimation,new PropertyPath("Angle")); Storyboard.SetTarget(angleAnimation,renderTransform); var storyboard = new Storyboard(); storyboard.Children.Add(angleAnimation); storyboard.Begin(); } </code></pre> <p>This StackPanel is actually inside a ItemsControl as a DataTemplate (so I have lots of these StackPanels on screen). Here's the xaml</p> <pre><code> &lt;Controls:CustomItemsControl ItemsSource="{Binding Fingers}" Height="2000" Width="330" &gt; &lt;Controls:CustomItemsControl.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;Canvas&gt; &lt;/Canvas&gt; &lt;/ItemsPanelTemplate&gt; &lt;/Controls:CustomItemsControl.ItemsPanel&gt; &lt;Controls:CustomItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel Canvas.Top="{Binding Top}" Canvas.Left="{Binding Left}" Tap="StackPanelTap" Tag="{Binding NoteName}"&gt; &lt;Image Source="{Binding Image}"/&gt; &lt;TextBlock Text="{Binding Text}" Margin="10,-45" Foreground="Black" FontSize="32"/&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/Controls:CustomItemsControl.ItemTemplate&gt; &lt;/Controls:CustomItemsControl&gt; </code></pre> <p>The animation works fine but only <em>one-at-a-time</em>. I would like to have multiple animations at the same time if my user taps multiple StackPanels. Is this possible with storyboards etc?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload