MainPage.xaml.cs
//UART*********************************************************************************
/// <summary>
/// ListAvailablePorts
/// - Use SerialDevice.GetDeviceSelector to enumerate all serial devices
/// - Attaches the DeviceInformation to the ListBox source so that DeviceIds are displayed
/// </summary>
ListAvailablePorts
Use SerialDevice.GetDeviceSelector to enumerate all serial devices
Attaches the DeviceInformation to the ListBox source so that DeviceIds are displayed
ListAvailablePorts Use SerialDevice . GetDeviceSelector to enumerate all serial devices Attaches the DeviceInformation to the ListBox source so that DeviceIds are displayed
private async void ListAvailablePorts()
        {
            try
            {
                string aqs = SerialDevice.GetDeviceSelector();
                var dis = await DeviceInformation.FindAllAsync(aqs);
                for (int i = 0; i < dis.Count; i++)
                {
                    listOfDevices.Remove(dis[i]);
                }
                for (int i = 0; i < dis.Count; i++)
                {
                    listOfDevices.Add(dis[i]);
                }
                DeviceListSource.Source = listOfDevices;
                ConnectDevices.SelectedIndex = -1;
            }
            catch
            {
            }
        }
private async void ListAvailablePorts ( ) { try { string aqs = SerialDevice . GetDeviceSelector ( ) ; var dis = await DeviceInformation . FindAllAsync ( aqs ) ; for ( int i = 0 ; i < dis . Count ; i ++ ) { listOfDevices . Remove ( dis [ i ] ) ; } for ( int i = 0 ; i < dis . Count ; i ++ ) { listOfDevices . Add ( dis [ i ] ) ; } DeviceListSource . Source = listOfDevices ; ConnectDevices . SelectedIndex = - 1 ; } catch { } }
ListAvailablePorts
 Use SerialDevice.GetDeviceSelector to enumerate all serial devices
 Attaches the DeviceInformation to the ListBox source so that DeviceIds are displayed
ListAvailablePorts Use SerialDevice . GetDeviceSelector to enumerate all serial devices Attaches the DeviceInformation to the ListBox source so that DeviceIds are displayed
//status.Text = "Select a device and connect"; //comPortInput.IsEnabled = true; //status.Text = ex.Message;