private static ScatterplotBox show(Scatterplot scatterplot)
{
ScatterplotBox form = null;
Thread formThread = null;
AutoResetEvent stopWaitHandle = new AutoResetEvent(false);
formThread = new Thread(() =>
{
Accord.Controls.Tools.ConfigureWindowsFormsApplication();
// Show control in a form
form = new ScatterplotBox();
form.Text = scatterplot.Title;
form.formThread = formThread;
form.scatterplotView1.Scatterplot = scatterplot;
stopWaitHandle.Set();
Application.Run(form);
});
formThread.SetApartmentState(ApartmentState.STA);
formThread.Start();
stopWaitHandle.WaitOne();
return form;
}