Created
December 12, 2019 02:22
-
-
Save houwasystemdesign/ad663cb3b30a9eedc918aaf2adfcc736 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async void OnAdvertisementReceived(BluetoothLEAdvertisementWatcher watcher, | |
BluetoothLEAdvertisementReceivedEventArgs eventArgs) | |
{ | |
//アドバタイズ受信した際の処理 | |
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => | |
{ | |
//同要素がなければListに追加 | |
AdvertisementListItem item = new AdvertisementListItem(eventArgs); | |
if (AdvertisementList.Select(x => x.BluetoothAddress).Where(x => x.Equals(item.BluetoothAddress)).Count() == 0) | |
{ | |
AdvertisementList.Add(item); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment