예제 #1
0
        // Initialize Stuff
        public async void Initialize()
        {
            CellularLines = await GetSmsDevices();

            if (CellularLines.Count != 0)
            {
                SelectedLine = CellularLines[0];
            }
        }
예제 #2
0
        // Methods
        private static async Task <ObservableCollection <CellularLineControl> > GetSmsDevices()
        {
            ObservableCollection <CellularLineControl> collection = new ObservableCollection <CellularLineControl>();
            var smsDevices = await DeviceInformation.FindAllAsync(SmsDevice2.GetDeviceSelector(), null);

            foreach (var smsDevice in smsDevices)
            {
                try
                {
                    SmsDevice2          dev     = SmsDevice2.FromId(smsDevice.Id);
                    CellularLineControl control = new CellularLineControl(dev);
                    collection.Add(control);
                }
                catch
                {
                }
            }
            return(collection);
        }
예제 #3
0
        private async void Load()
        {
            var smsDevices = await DeviceInformation.FindAllAsync(SmsDevice2.GetDeviceSelector(), null);

            foreach (var smsDevice in smsDevices)
            {
                try
                {
                    SmsDevice2          dev     = SmsDevice2.FromId(smsDevice.Id);
                    CellularLineControl control = new CellularLineControl(dev);
                    cellularlineControls.Add(control);
                    CellularLineComboBox.Items.Add(new ComboBoxItem()
                    {
                        Content = control
                    });
                }
                catch
                {
                }
            }
        }