Note that there are some explanatory texts on larger screens.

plurals
  1. POBest way to do this animation in Silverlight 4?
    primarykey
    data
    text
    <p>I'm building a Windows Phone 7 app in Silverlight.</p> <p>I have a list of content in a <code>ListBox</code>. When the user presses a button, "Remove" icons should appear next to each item in the list. Ideally, the list items would slide over, and the icons would be animated in.</p> <p>I'm not sure what the best way to go about doing this is. I'm unfamiliar with animation in Silverlight. One approach: make a data template for the ListBox that includes the icon and the actual content. If the user hits the button, toggle the visibility of the icon. Attach event handlers to the icon being tapped. (I'm not sure how to work animation into this.)</p> <p>Or is there another way to make this work?</p> <p><strong>Update</strong>: Ok, I have a nice animation where the content slides out and back. However, I'd like to add an icon for each item in the list. How can I do this?</p> <pre><code>&lt;VisualStateManager.CustomVisualStateManager&gt; &lt;ic:ExtendedVisualStateManager/&gt; &lt;/VisualStateManager.CustomVisualStateManager&gt; &lt;VisualStateManager.VisualStateGroups&gt; &lt;VisualStateGroup x:Name="EditingStates"&gt; &lt;VisualStateGroup.Transitions&gt; &lt;VisualTransition GeneratedDuration="0:0:1"/&gt; &lt;/VisualStateGroup.Transitions&gt; &lt;VisualState x:Name="Editing"&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Duration="0" To="60" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="pivotItem" d:IsOptimized="True"/&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;VisualState x:Name="NotEditing"&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="pivotItem" d:IsOptimized="True"/&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;/VisualStateGroup&gt; &lt;/VisualStateManager.VisualStateGroups&gt; </code></pre> <p>Also, right now this is hardcoded to be a specific control. How can I change it to be the <code>pivotItem</code> the user is currently viewing?</p>
    singulars
    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.
 

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