private void calRunner_OnResult(object sender, CalibrationRunnerEventArgs e) { // Invoke on UI thread since we are accessing UI elements if (RatingText.Dispatcher.Thread != Thread.CurrentThread) { this.Dispatcher.BeginInvoke(new MethodInvoker(() => calRunner_OnResult(sender, e))); return; } // Show calibration results rating if (e.Result == CalibrationRunnerResult.Success) { isCalibrated = true; UpdateState(); } else MessageBox.Show(this, "Calibration failed, please try again"); }
/// <summary> /// Handles the OnResult event of the calRunner control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="CalibrationRunnerEventArgs"/> instance containing the event data.</param> private void calRunner_OnResult(object sender, CalibrationRunnerEventArgs e) { var result = e.CalibrationResult; // Show a calibration plot if everything went OK if (result != null) { this.theEyeTribeCalibrationResultPanel.Initialize(result); this.ShowCalibPlot(); } else { MessageBox.Show("Not enough data to create a calibration (or calibration aborted)."); } }
private void calRunner_OnResult(object sender, CalibrationRunnerEventArgs e) { if (RatingText.Dispatcher.Thread != Thread.CurrentThread) { this.Dispatcher.BeginInvoke(new MethodInvoker(() => calRunner_OnResult(sender, e))); return; } if (e.Result == CalibrationRunnerResult.Success) { RatingText.Text = RatingFunction(e.CalibrationResult); } else { System.Windows.MessageBox.Show("Calibration failed, please try again"); } }