Beispiel #1
0
 private void OnDeviceDiscovered(object sender, DeviceEventArgs e)
 {
     IDevice device = e.Device;
     var vm = scanDevices.FirstOrDefault(d => d.Device.Id == device.Id);
     if (vm == null)
     {
         ScanDeviceViewModel model = new ScanDeviceViewModel
         {
             Device = device,
             Name = device.Name ?? "Unknow"
         };
         scanDevices.Add(model);
     }
 }
Beispiel #2
0
 private void OnScanDevicesItemSelected(object sender, SelectedItemChangedEventArgs e)
 {
     ScanDeviceViewModel model = (ScanDeviceViewModel)e.SelectedItem;
     IDevice device = model.Device;
     _ = ConnectDevice(device);
 }