private void begin_Click(object sender, RoutedEventArgs e) { buttonState = !buttonState; if (buttonState) { begin.Content = "开始"; Storyboard1.Stop(); int r1 = r.Next(0, count); int r2 = r.Next(0, count); int r3 = r.Next(0, count); content1.Text = list.ElementAt(r1).Content; content2.Text = list.ElementAt(r2).Content; content3.Text = list.ElementAt(r3).Content; content2.Visibility = Visibility.Collapsed; content3.Visibility = Visibility.Collapsed; } else { begin.Content = "停止"; Storyboard1.RepeatBehavior = RepeatBehavior.Forever; content3.Visibility = Visibility.Visible; content2.Visibility = Visibility.Visible; Storyboard1.Begin(); } }
void Storyboard1_Completed(object sender, EventArgs e) { int i = r.Next(2); Storyboard1.Stop(); //Storyboard.SetTargetName(animation1, "image" + (i + 1)); //Storyboard.SetTargetName(animation2, "rectangle" + (i + 1)); //Storyboard1.Begin(); }
public LiveLocationIcon() { InitializeComponent(); Loaded += (sender, args) => { Storyboard1.Begin(); Storyboard2.Begin(); }; Unloaded += (sender, args) => { Storyboard1.Stop(); Storyboard2.Stop(); }; }
public UploadingControl() { InitializeComponent(); Loaded += (sender, args) => { Storyboard1.Begin(); Storyboard2.Begin(); Storyboard3.Begin(); }; Unloaded += (sender, args) => { Storyboard1.Stop(); Storyboard2.Stop(); Storyboard3.Stop(); }; }
private void BtnDownloadButton_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) { Storyboard1.Stop(); }
private void BtnDownloadButton_MouseLeave(object sender, MouseEventArgs e) { Storyboard1.Stop(); }