Dim BLEScan As Object 'for waiting on
BLEScan = Globals.bluetoothDevs.ScanBLE 'start background scanning
' ...
'user interaction code that have variable completion time
' ...
ToastMessage.ShowProgress("Scanning Bluetooth")
Wait For (BLEScan) Complete (success As Boolean)
ToastMessage.HideProgress