using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.Windows.Threading; namespace PipeGallery.View { /// <summary> /// StartView.xaml 的交互逻辑 /// </summary> public partial class StartView : UserControl { Border _bdr = null; public StartView(Border bdr) { _bdr = bdr; InitializeComponent(); this.Loaded += StartView_Loaded; } void StartView_Loaded(object sender, RoutedEventArgs e) { //倒计时 DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(3); timer.Tick += new EventHandler(timer_Tick); timer.IsEnabled = true; timer.Start(); } void timer_Tick(object sender, EventArgs e) { //加载首页 Border bdr = this.Parent as Border; if (bdr!=null) { HomePageView homePageView = new HomePageView(); bdr.Child = null; _bdr.Child = homePageView; } } } }