Beispiel #1
0
 private void ReadMapWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     mapReader                 = e.Result as MapReader;
     this.DataContext          = mapReader;
     exportMapButton.IsEnabled = true;
     readMapButton.IsEnabled   = true;
 }
Beispiel #2
0
        private void ReadMapButton_Click(object sender, RoutedEventArgs e)
        {
            readMapButton.IsEnabled = false;
            var reader = new MapReader();
            BackgroundWorker readMapWorker = new BackgroundWorker
            {
                WorkerReportsProgress = true
            };

            readMapWorker.DoWork             += reader.ReadMap;
            readMapWorker.ProgressChanged    += ReadMapWorker_ProgressChanged;
            readMapWorker.RunWorkerCompleted += ReadMapWorker_RunWorkerCompleted;
            readMapWorker.RunWorkerAsync();
        }