コード例 #1
0
        public void HandleSelectedItem(Guid id)
        {
            MovesenseDeviceViewModel item = Devices.First(d => d.Uuid == id);

            item.IsSelected = !item.IsSelected;
            if (item.IsSelected)
            {
                App.Locator.LinearAccelerationPageVM.MovesenseDeviceVM = item;
            }
            // If none selected, clear setting
            if (Devices.FirstOrDefault(x => x.IsSelected) == null)
            {
                App.Locator.LinearAccelerationPageVM.MovesenseDeviceVM = null;
            }
        }
コード例 #2
0
 void OnScanResult(IScanResult result)
 {
     // Only interested in Movesense devices
     if (result.Device.Name != null)
     {
         if (result.Device.Name.StartsWith("Movesense"))
         {
             var dev = this.Devices.FirstOrDefault(x => x.Uuid.Equals(result.Device.Uuid));
             if (dev != null)
             {
                 dev.TrySet(result);
             }
             else
             {
                 dev = new MovesenseDeviceViewModel();
                 dev.TrySet(result);
                 this.Devices.Add(dev);
             }
         }
     }
 }