private async void OnDeviceRemoved(DeviceWatcher sender, DeviceInformationUpdate args) { serialDevice.CancelReading(); await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => pageTitle.Text = "Device removed"); }