private void OnGenerate(ProgressEventArgs progressEventArgs) { if (Generation != null) Generation(this, progressEventArgs); }
void Display_Generation(object sender, ProgressEventArgs e) { this.Dispatcher.BeginInvoke(delegate() { GenerateProgress.Value = e.CurrentPruned; GenerateProgress.Maximum = e.TargetPruned; GenerateProgress.Minimum = 0; GenerateProgress.Visibility = e.CurrentPruned >= e.TargetPruned ? Visibility.Collapsed : Visibility.Visible; if (e.CurrentPruned < e.TargetPruned) { timer.Change(-1, -1); } else { TimerDisplay.Text = "0:00"; secCount = 0; timer.Change(0, 1000); } }); }