private void LoadPicker()
        {
            isPickerActive = true;

            try
            {
                if (oBluetooth.CheckConnection())
                {
                    oBluetooth.CloseConnection();
                }

                oBluetooth.LoadPairedDevices();

                if (oBluetooth.Count == 0)
                {
                    throw new Exception("No devices found");
                }

                pkrDevices.ItemsSource = oBluetooth;

                pkrDevices.Focus();
            }
            catch (Exception ex)
            {
                DisplayMessage(ex.Message);
            }
        }
Example #2
0
        private void btnDisconnect_Clicked(object sender, EventArgs e)
        {
            if (!isTimerRun)
            {
                return;
            }

            isTimerRun = false;

            if (Logging.GetIsLogging())
            {
                StopLogging();
            }

            oBluetooth.CloseConnection();

            Bluetooth.SetBluetoothState(Bluetooth.BLUETOOTH_STATE.DISCONNECTED);
            UpdateControls();
        }