Exemple #1
0
        private static void LoadGroupWindow()
        {
            var groupWindowThread = new Thread(new ThreadStart(() =>
            {
                SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
                GroupWindow = new GroupWindow();
                GroupWindow.Show();
                waiting = false;

                Dispatcher.Run();
            }));

            groupWindowThread.Name = "Group window thread";
            groupWindowThread.SetApartmentState(ApartmentState.STA);
            groupWindowThread.Start();
            Debug.WriteLine("Group window loaded");
        }
        private static void LoadGroupWindow()
        {
            var groupWindowThread = new Thread(() =>
            {
                SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
                Thread.CurrentThread.Priority = ThreadPriority.BelowNormal;
                GroupWindow = new GroupWindow();
                if (GroupWindow.WindowSettings.Enabled)
                {
                    GroupWindow.Show();
                }
                AddDispatcher(Thread.CurrentThread.ManagedThreadId, Dispatcher.CurrentDispatcher);
                Dispatcher.Run();
                RemoveDispatcher(Thread.CurrentThread.ManagedThreadId);
            })
            {
                Name = "Group"
            };

            groupWindowThread.SetApartmentState(ApartmentState.STA);
            groupWindowThread.Start();
        }