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();
        }
Exemplo n.º 2
0
        protected override Window CreateShell()
        {
            splash = Container.Resolve <SplashScreenView>();

            splash.Show();

            return(splash);
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        private void ShowSplash()
        {
            // Create the window
            SplashScreenView animatedSplashScreenWindow = new SplashScreenView();

            splashScreen = animatedSplashScreenWindow;

            // Show it
            animatedSplashScreenWindow.Show();

            // Now that the window is created, allow the rest of the startup to run
            ResetSplashCreated.Set();
            System.Windows.Threading.Dispatcher.Run();
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
        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();
                }));
            });
        }
Exemplo n.º 7
0
        public static SplashScreenViewModel CreateSplashScreen(
            string header, string title, string initialLoadingMessage, int minimumMessageDuration)
        {
            var viewModel = new SplashScreenViewModel(initialLoadingMessage, minimumMessageDuration)
            {
                Header = header,
                Title  = title
            };
            Thread thread = new Thread(() =>
            {
                var splashScreen     = new SplashScreenView(viewModel);
                splashScreen.Topmost = true;
                splashScreen.Show();
                splashScreen.Closed += (x, y) => splashScreen.Dispatcher.InvokeShutdown();
                System.Windows.Threading.Dispatcher.Run();
            });

            thread.SetApartmentState(ApartmentState.STA);
            thread.IsBackground = true;
            thread.Start();

            return(viewModel);
        }
Exemplo n.º 8
0
        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();
                });
            });
        }