// Worker thread function.
        // Called indirectly from btnStartThread_Click
        private void WorkerThreadFunction()
        {
            LongProcess longProcess;

            longProcess = new LongProcess(m_EventStopThread, m_EventThreadStopped, this);
            longProcess.Run();
        }
Example #2
0
        public void Start(LongProcess longProcess)
        {
            if (Application.Current == null)
            {
                new Application();
            }

            _waitView.Loaded += (sender, e) =>
            {
                longProcess.Invoke(() =>
                {
                    Application.Current.Dispatcher.Invoke(() => { _waitView.Close(); });
                });
            };

            _waitView.ShowDialog();
        }