void HandlePeripheralSelected (object sender, PeripheralSelectedEventArgs e) { StopScanning (); // show our connecting... overlay connectingDialog.LabelText = string.Format("Connecting to {0}", e.SelectedPeripheral.Name); connectingDialog.Show (true); // when the peripheral connects, load our details screen BluetoothLEManager.Current.DeviceConnected += HandleDeviceConnected; // try and connect to the peripheral BluetoothLEManager.Current.CentralBleManager.ConnectPeripheral (e.SelectedPeripheral, new PeripheralConnectionOptions ()); }
void HandlePeripheralSelected(object sender, PeripheralSelectedEventArgs e) { StopScanning(); // show our connecting... overlay connectingDialog.LabelText = string.Format("Connecting to {0}", e.SelectedPeripheral.Name); connectingDialog.Show(true); // when the peripheral connects, load our details screen BluetoothLEManager.Current.DeviceConnected += HandleDeviceConnected; // try and connect to the peripheral BluetoothLEManager.Current.CentralBleManager.ConnectPeripheral(e.SelectedPeripheral, new PeripheralConnectionOptions()); }