星火微课系统客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CountdownWindow.xaml.cs 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. using System.Windows.Threading;
  5. namespace XHWK.WKTool
  6. {
  7. /// <summary>
  8. /// CountdownWindow.xaml 的交互逻辑
  9. /// </summary>
  10. public partial class CountdownWindow : Window
  11. {
  12. DispatcherTimer timer = null;
  13. public CountdownWindow()
  14. {
  15. InitializeComponent();
  16. Initialize();
  17. }
  18. public void Initialize()
  19. {
  20. //Thread.Sleep(1200);
  21. //this.Hide();
  22. //MediaElement.Position
  23. //((MediaElement)((object)ImgGif)).Position= TimeSpan.Zero;
  24. timer = new DispatcherTimer
  25. {
  26. Interval = TimeSpan.FromMilliseconds(2500)
  27. };
  28. timer.Tick += Timer_Tick;
  29. timer.Start();
  30. }
  31. private void Timer_Tick(object sender, EventArgs e)
  32. {
  33. this.Hide();
  34. timer.Stop();
  35. }
  36. /// <summary>
  37. /// 跳转页面
  38. /// </summary>
  39. /// <param name="sender"></param>
  40. /// <param name="e"></param>
  41. private void Window_ContentRendered(object sender, EventArgs e)
  42. {
  43. //Thread.Sleep(800);
  44. ////imgLoding.Source= new BitmapImage(new Uri("pack://application:,,/Images/countdown_2.png"));
  45. ////Thread.Sleep(300);
  46. ////imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown_1.png"));
  47. ////Thread.Sleep(300);
  48. //this.Hide();
  49. //Initialize();
  50. }
  51. private void Image_MediaEnded(object sender, RoutedEventArgs e)
  52. {
  53. ((MediaElement)sender).Position = ((MediaElement)sender).Position.Add(TimeSpan.FromMilliseconds(10000));
  54. }
  55. }
  56. }