示例#1
0
        public App()
        {
            var dir = System.AppDomain.CurrentDomain.BaseDirectory;

            this.WindowPlacement = new WindowPlace(dir + @"placement.config");
            this.disposables = new CompositeDisposable();
        }
示例#2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var splashScreen = new SplashScreen();

            MainWindow = splashScreen;
            splashScreen.Show();

            Task.Factory.StartNew(() =>
            {
                Execute.OnUIThread(() => splashScreen.ProgressStatus.Content = "Registering dependencies");
                RegisterTypes();

                // var task = Task.Factory.StartNew(() => TaskCreationOptions.LongRunning);
                Execute.OnUIThread(() => splashScreen.ProgressStatus.Content = "Starting BackgroundWorker");
                var backgroundWorker     = new BackgroundWorker();
                backgroundWorker.DoWork += DoWork;
                backgroundWorker.RunWorkerAsync();

                Execute.OnUIThread(() => splashScreen.ProgressStatus.Content = "Resolving dependencies");

                container.Resolve <IEventSubscriber>("macro");
                container.Resolve <IEventSubscriber>("skill");

                Execute.OnUIThread(() => splashScreen.ProgressStatus.Content = "Launching main window");
                Execute.OnUIThread(() =>
                {
                    WindowPlace = new WindowPlace("placement.config");

                    var mainVM = container.Resolve <IViewModel>("main");
                    MainWindow = new MainWindow {
                        DataContext = mainVM
                    };
                    MainWindow.Show();
                    splashScreen.Close();
                });
            });
        }
 public App()
 {
     // Set a name of config file
     this.WindowPlace = new WindowPlace(@"placement.config");
 }
示例#4
0
 public App()
 {
     appFiles    = new AppFiles();
     windowPlace = new WindowPlace("window.config");
     LoadFiles();
 }
示例#5
0
 public App()
 {
     windowPlace = new WindowPlace("window.config");
     Exit       += OnExit;
 }