Exemplo n.º 1
0
        void Progres()
        {
            SynchronizationContext context = SynchronizationContext.Current;

            Thread backgroundThread = new Thread(
                new ThreadStart(() =>
            {
                for (int n = 0; n < 1000; n++)
                {
                    Thread.Sleep(5);
                    context?.Post(new SendOrPostCallback((o) =>
                    {
                        ProgressBar.Value = n;
                    }), null);

                    if (n.Equals(999))
                    {
                        this.Dispatcher.Invoke(() =>
                        {
                            sw.Stop();
                            StudyPageViewAction.ChangeStudyPage(sw.Elapsed, 1);
                        });
                    }
                }
                ;
            }
                                ));

            backgroundThread.Start();
        }
Exemplo n.º 2
0
        private void Btn4_OnClick(object sender, RoutedEventArgs e)
        {
            int answer = 4;

            sw.Stop();
            StudyPageViewAction.ChangeStudyPage(sw.Elapsed, answer);
        }
Exemplo n.º 3
0
 private void BtnConfirm_OnClick(object sender, RoutedEventArgs e)
 {
     Application.Current.Windows.OfType <MainWindow>().FirstOrDefault().frame.Content = StudyPageViewAction.InitialStudyPage();
 }