Exemplo n.º 1
0
        public App()
        {
            var dir = System.AppDomain.CurrentDomain.BaseDirectory;

            this.WindowPlacement = new WindowPlace(dir + @"placement.config");
            this.disposables = new CompositeDisposable();
        }
Exemplo n.º 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();
                });
            });
        }
Exemplo n.º 3
0
 public App()
 {
     // Set a name of config file
     this.WindowPlace = new WindowPlace(@"placement.config");
 }
Exemplo n.º 4
0
 public App()
 {
     appFiles    = new AppFiles();
     windowPlace = new WindowPlace("window.config");
     LoadFiles();
 }
Exemplo n.º 5
0
 public App()
 {
     windowPlace = new WindowPlace("window.config");
     Exit       += OnExit;
 }