Skip to content

Instantly share code, notes, and snippets.

@marqzosvaldo
Last active December 13, 2019 05:06
Show Gist options
  • Save marqzosvaldo/150f24900c243bb01ee33105a8841e18 to your computer and use it in GitHub Desktop.
Save marqzosvaldo/150f24900c243bb01ee33105a8841e18 to your computer and use it in GitHub Desktop.
Evento Estado de Bluetooth
_ble.StateChanged += (s, e) => {
try {
switch (_ble.State) {
case BluetoothState.On:
page.DisplayAlert("Bluetooth Activado ", "Escaneando...", "OK");
ScanDevicesCommand.Execute(null);
break;
case BluetoothState.Off:
page.DisplayAlert("Bluetooth Desactivado", $"Activa tu bluetooth en configuraciones", "OK");
SelectionMode = SelectionMode.None;
break;
}
} catch (Exception ex) {
Debug.WriteLine(ex);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment