private void OpenGlWindowInNewThread() { //Opens the live view window if it is not open yet. Task.Run(() => { if (GLWind == null) { isRunning = true; GLWind = new OpenGLWindow(); //The variables below are shared between this class and the OpenGLWindow. lock (_frame.Vertices) { GLWind.frame.Vertices = _frame.Vertices; GLWind.frame.Colors = _frame.Colors; GLWind.cameraPoses = _frame.CameraPoses; } GLWind.Run(30.0f); } }); }