Choppy Animation

Aug 25, 2010 at 8:33 PM

I am testing the InfoStrat.VE package for use with a new project. I started with the WPF test application, and started adding animations. The animation seems to run fine for a few seconds, then gets really choppy. I tried this in debug and release mode, running from Visual Studio as well as running the compiled application outside of the development environment.

Is this typical of animations?

Specifically, I very basically modified the WPFVEMapSampleWindow.xaml file PushPin declaration to have an animation on the Latitude property:

<ve:VEPushPin Name="InfoStratPushPin"
                Latitude="38.9444195081574"
                          Longitude="-77.0630161230201"
                          Click="VEPushPin_Click">
                <StackPanel>
                    <TextBlock Text="Hello, WPF!"
                               HorizontalAlignment="Center"
                               FontSize="20" />
                    <TextBlock Text="www.infostrat.com"
                               HorizontalAlignment="Center" />
                </StackPanel>
                <ve:VEPushPin.Triggers>
                    <EventTrigger RoutedEvent="ve:VEPushPin.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation 
                                    Storyboard.TargetName="InfoStratPushPin" 
                                    Storyboard.TargetProperty="Latitude"
                                    From="38.9444195081574" To="38.9484195081574" Duration="0:0:1"
                                    AutoReverse="True" RepeatBehavior="Forever" />
                            </Storyboard>
                        </BeginStoryboard>
                        
                    </EventTrigger>
                </ve:VEPushPin.Triggers>
            </ve:VEPushPin>

 

 

 

Coordinator
Aug 25, 2010 at 10:02 PM

The pushpin locations are already animated. If you change the latitude or longitude from one position to another, they will animate to the new position. The approach you are taking is causing nested animations to occur every frame, which explains the choppiness.

Just change the latitude and longitude to the final position and it should be fine.

 

 

Aug 26, 2010 at 2:26 PM

Hey, thanks for the response! That makes perfect sense.