Quantcast
Channel: Start/Stop WPF animation
Viewing all articles
Browse latest Browse all 4

Start/Stop WPF animation

$
0
0

Hi,

First remove the below code from your .XAML file -

<Window.Triggers>
  <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
     </EventTrigger>
 </Window.Triggers>

Add below code in your Button Click Event -

privatevoid StartClick(object sender, RoutedEventArgs e)

{

Storyboard SB = (Storyboard)FindResource("Storyboard1");

SB.Stop();

SB.Begin();

}

privatevoid StopClick(object sender, RoutedEventArgs e)

{

Storyboard SB = (Storyboard)FindResource("Storyboard1");

SB.Stop();

}

BTW - For WPF Question there is a seperate Forum - Here it is - http://social.msdn.microsoft.com/Forums/en/wpf/threads/

Thanks,

Pravinkumar

"Please mark as answered, if this answers your question"


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>