private void OnCharacteristicSelected(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count > 0) { selectedCharacteristic = (GattCharacteristic)((Entity)e.AddedItems[0]).Item; if (selectedCharacteristic != null) { enuminator.Hide(); enuminator = null; Status = "Connected"; OnConnect(this, new ConnectEventArgs("Success")); } } }
private void DeviceSelected(object sender, SelectionChangedEventArgs e) { enuminator.Hide(); if (e.AddedItems.Count > 0) { kinectSensor = (KinectSensor)((Entity)e.AddedItems[0]).Item; if (kinectSensor.Status == KinectStatus.Connected) { Name = kinectSensor.UniqueKinectId; OnConnect(this, new ConnectEventArgs("Success")); return; } } else { OnConnect(this, new ConnectEventArgs("Error", "No Kinect Devices Selected.")); return; } OnConnect(this, new ConnectEventArgs("Error", "Unable to connect to Kinect.")); }