private async void Main_Loaded(object sender, EventArgs e) {
            Downloads = new ViewDownloadsWindow();
            Downloads.Owner = Main;
            Downloads.DownloadsView.ItemsSource = Business.DownloadManager.DownloadsList;

            InitializingWindow InitWin = new InitializingWindow();
            InitWin.Owner = Main;

            CancellationToken token = new CancellationToken();
            Task InitWinTask = Task.Factory.StartNew(
                            () => InitWin.ShowDialog(),
                            token,
                            TaskCreationOptions.None,
                            TaskScheduler.FromCurrentSynchronizationContext());

            await TestDatabaseConnectionAsync();

            InitWin.Close();
            await InitWinTask;

            if (Settings.SavedFile == null)
                SettingsWindow.Instance();

            await Main.InitializationCompleted();
        }
Exemple #2
0
        private async void Main_Loaded(object sender, EventArgs e)
        {
            if (NgMain != null)
            {
                Downloads       = new ViewDownloadsWindow();
                Downloads.Owner = Main;
                Downloads.DownloadsView.ItemsSource = Business.DownloadManager.DownloadsList;
            }

            SplashWindow InitWin = SplashWindow.Instance(Main, SplashImage);

            SplashImage = null;
            // InitWin.Owner = Main;

            CancellationToken token = new CancellationToken();
            Task InitWinTask        = Task.Factory.StartNew(
                () => InitWin.ShowDialog(),
                token,
                TaskCreationOptions.None,
                TaskScheduler.FromCurrentSynchronizationContext());

            await TestDatabaseConnectionAsync();

            if (Settings.SavedFile == null)
            {
                AboutWindow.Instance();
                SettingsWindow.Instance();
            }

            if (NgMain != null)
            {
                await NgMain.InitializationCompleted();
            }

            InitWin.CanClose();
            await InitWinTask;
        }