Hello,
Welcome to our Microsoft Q&A platform!
Actually, it was a threading issue. The BluetoothLEAdvertisementWatcher's received event is generated on a different thread than the UI thread. As a result, you can't access the TextBox in the normal way as before. In UWP we recommend using Dispatcher.RunAsync to schedule work on the main UI thread.
The following code shows the fix about this issue:
public void NotifyUser(string strMessage)
{
// If called from the UI thread, then update immediately.
// Otherwise, schedule a task on the UI thread to perform the update.
if (Dispatcher.HasThreadAccess)
{
UpdateStatus(strMessage);
}
else
{
var task = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => UpdateStatus(strMessage));
}
}
Thanks.