|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using System;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Threading;
-
- namespace XHWK.WKTool
- {
- /// <summary>
- /// CountdownWindow.xaml 的交互逻辑
- /// </summary>
- public partial class CountdownWindow : Window
- {
- DispatcherTimer timer = null;
- public CountdownWindow()
- {
- InitializeComponent();
- Initialize();
- }
- public void Initialize()
- {
- //Thread.Sleep(1200);
- //this.Hide();
- //MediaElement.Position
- //((MediaElement)((object)ImgGif)).Position= TimeSpan.Zero;
- timer = new DispatcherTimer
- {
- Interval = TimeSpan.FromMilliseconds(2500)
- };
- timer.Tick += Timer_Tick;
- timer.Start();
- }
-
- private void Timer_Tick(object sender, EventArgs e)
- {
- this.Hide();
- timer.Stop();
- }
-
- /// <summary>
- /// 跳转页面
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Window_ContentRendered(object sender, EventArgs e)
- {
- //Thread.Sleep(800);
- ////imgLoding.Source= new BitmapImage(new Uri("pack://application:,,/Images/countdown_2.png"));
- ////Thread.Sleep(300);
- ////imgLoding.Source = new BitmapImage(new Uri("pack://application:,,/Images/countdown_1.png"));
- ////Thread.Sleep(300);
- //this.Hide();
-
- //Initialize();
- }
-
- private void Image_MediaEnded(object sender, RoutedEventArgs e)
- {
- ((MediaElement)sender).Position = ((MediaElement)sender).Position.Add(TimeSpan.FromMilliseconds(10000));
- }
- }
- }
|