public MainPage() { this.usbDevices = new List <UsbDeviceInfo>(); this.serialDevices = new List <SerialDeviceInfo>(); this.InitializeComponent(); SetupControls(); //CreateNewCSVFile(); // Needs to be done per experiment in the UI //SensorsLive.DataContext = CurrentRecordCache; IoTHubSetup(); ExperimentCharts.SetCache(ref Cache); RPMGauge.SetCache(ref Cache); // Start concurrent queue listener Task.Run(StartBackgroundLoop); // Start/Stop data read lock (lockObj) { this.bPauseDataRead = !this.bPauseDataRead; } if (this.bPauseDataRead) { this.state.serialWire.Update(DataFlow.Stopped); } else { } }