private static bool CanDisableBluetooth(BluetoothAdapter adapter) { return(adapter.IsEnabled && // only disconnect if bluetooth is not in use !BluetoothHelper.GuessHasActiveConnection(adapter)); }