public MainWindow() { // SplashScreenの表示 var splashScreen = new SplashScreenView(); splashScreen.Show(); // SplashScreen表示中にViewModelの読み込み var timer = new Stopwatch(); timer.Start(); var vm = new MainWindowViewModel(); vm.InitViewFolder(); DataContext = vm; timer.Stop(); // 一定時間待機後、SplashScreenを閉じる if (MIN_SPL_TIME - timer.ElapsedMilliseconds > 0) { Thread.Sleep(MIN_SPL_TIME); } splashScreen.Close(); InitializeComponent(); }
protected override void OnInitialized() { // have no idea if it makes sense, but works var mainWindow = Container.Resolve <MainWindow>(); var eventAggregator = Container.Resolve <IEventAggregator>(); eventAggregator.GetEvent <AllModulesLoaded>().Publish(); splash.Close(); mainWindow.ShowDialog(); Current.Shutdown(); }
protected async override void OnStartup(StartupEventArgs e) { SplashScreenView splashScreen = new SplashScreenView(); splashScreen.Show(); base.OnStartup(e); await Task.Delay(4000); MainWindow main = new MainWindow(); main.Show(); splashScreen.Close(); }
protected override async void OnStartup(StartupEventArgs e) { base.OnStartup(e); var splashScreen = new SplashScreenView(); splashScreen.Show(); await splashScreen.LoadDataAsync(); var mainView = new MainWindowView(); mainView.Show(); splashScreen.Close(); }
private async Task ShowSplashScreen() { SplashScreenView splashScreenView = new SplashScreenView(); Task splashTask = Task.Factory.StartNew(() => { Current.Dispatcher.BeginInvoke(new Action(() => { splashScreenView.Show(); })); }); await Task.Delay(MainApplication.Properties.Settings.Default.SplashScreenTime); splashTask = Task.Factory.StartNew(() => { Current.Dispatcher.BeginInvoke(new Action(() => { splashScreenView.Close(); })); }); }
public App() { var ss = new SplashScreenView(); this.MainWindow = ss; ss.Show(); Task.Factory.StartNew(() => { // static 呼び出し用(Ace実体を探し中・・・) var a = AceUtil.NodeVersion; Debug.WriteLine(a); // UI thread this.Dispatcher.Invoke(() => { // メイン起動しスイッチ this.MainWindow = new MainWindow(); this.MainWindow.Show(); ss.Close(); }); }); }