private CameraWindow getCameraView()
 {
     if (null == cameraView || cameraView.isClosed)
     {
         Cursor = Cursors.Wait;
         cameraView = new CameraWindow(SENSOR_IDX);
         Cursor = Cursors.Arrow;
     }
     return cameraView;
 }
        private void uiUpdate_Tick(object sender, EventArgs e)
        {
            ISensorService sensorService = SpringUtil.getService<ISensorService>();

            // checks that the kinect is connected
            if (sensorService.sensorAvailable(SENSOR_IDX))
            {
                startCameraButton.IsEnabled = true;
                startStopButton.IsEnabled = true;
            }
            else
            {
                startCameraButton.IsEnabled = false;
                startStopButton.IsEnabled = false;

                // stop interaction service
                if (null != interaction)
                {
                    interaction = null;
                }

                // close camera window
                if (null != cameraView)
                {
                    cameraView.Stop();
                    cameraView.Close();
                    cameraView = null;
                }
            }
        }