123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Windows;
- using System.Windows.Media.Animation;
- namespace ClickOnceSetup
- {
- /// <summary>
- /// UCWaitingProgress.xaml 的交互逻辑
- /// </summary>
- public partial class UCWaitingProgress
- {
- private Storyboard storyboard;
- public UCWaitingProgress()
- {
- InitializeComponent();
- storyboard = (Resources["waiting"] as Storyboard);
- }
- private void Image_Loaded(object sender, RoutedEventArgs e)
- {
- Begin();
- }
- public void Begin()
- {
- Dispatcher.BeginInvoke(new Action(() =>
- {
- storyboard.Begin(image, true);
- }));
- }
- public void Stop()
- {
- Dispatcher.BeginInvoke(new Action(() =>
- {
- storyboard.Pause(image);
- }));
- }
- }
- }
|