private void OpenSensor(int sensorIndx, bool withColor, bool withBodyTracking) { try { var connectionString = "device/sensor" + sensorIndx.ToString(CultureInfo.InvariantCulture); var set = Astra.StreamSet.Open(connectionString); var sensorViewModel = new SensorViewModel(Properties.Settings.Default, Dispatcher, set, withColor, withBodyTracking); var wnd = new SensorWindow(sensorViewModel) { Owner = this }; wnd.Title += " #" + sensorIndx; wnd.Show(); } catch (Exception exc) { MessageBox.Show($"Cannot open depth sensor #{sensorIndx}:\r\n{exc.Message}", "Error"); } }
private void nextup(int sensorIndex, bool color1, bool tracking) { try { // connecting with the device (orbbec astra) var connectionString = "device/sensor" + sensorIndex.ToString(CultureInfo.InvariantCulture); var set = Astra.StreamSet.Open(connectionString); var sensorViewModel = new SensorViewModel(Properties.Settings.Default, Dispatcher, set, color1, tracking); // switch/redirect to the next page var wnd = new test123(sensorViewModel) { Owner = this }; wnd.Title += " #" + sensorIndex; wnd.Show(); } catch (Exception exc) { MessageBox.Show($"Cannot open depth sensor #{sensorIndex}:\r\n{exc.Message}", "Error"); } }
internal test123(SensorViewModel viewModel) : this() { DataContext = viewModel; }
internal SensorWindow(SensorViewModel viewModel) : this() { DataContext = viewModel; }