private void OnSelectJsonFile(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count != 1)
            {
                return;
            }
            var name = (e.AddedItems[0] as ComboBoxItem).Content as string;

            var localSettings = ApplicationData.Current.LocalSettings;

            localSettings.Values[SAVED_DEVICE_NAME] = name;

            SelectedNameDevice = BleNames.GetDevice(name, BleNames.AllRawDevices);
            DisplaySelection();
        }
示例#2
0
        protected async override void OnNavigatedTo(NavigationEventArgs args)
        {
            var di = args.Parameter as DeviceInformationWrapper;

            uiProgress.IsActive = true;

            try
            {
                ble = await BluetoothLEDevice.FromIdAsync(di.di.Id);

                if (ble != null)
                {
                    var knownDevice = BleNames.GetDevice(ble.Name);
                    BleDeviceId = ble.DeviceId;
                    await DisplayBluetooth(knownDevice, di, ble);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine($"ERROR: unable to navigate {ex.Message}");
                // I don't know of any exceptions. But if there are any, supress them completely.
            }
            NavigationComplete = true;
        }