private void DisplayNetworkReport(WiFiNetworkReport report)
 {
     NetworkCollection.Clear();
     foreach (var network in report.AvailableNetworks)
     {
         NetworkCollection.Add(new WiFiNetworkDisplay(network, _firstAdapter));
     }
 }
Exemplo n.º 2
0
        public override async Task OnSearch(object value = null)
        {
            await _model.SearchNetworkAsync();

            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                NetworkCollection.Clear();
                foreach (NetworkInterfaces net in _model.NetworkCollection)
                {
                    NetworkCollection.Add(net);
                }
            }));
        }
        private async Task <bool> UpdateNetworkInfo()
        {
            DeviceName  = DeviceInfoPresenter.GetDeviceName();
            IPAddress   = NetworkPresenter.GetCurrentIpv4Address();
            NetworkName = NetworkPresenter.GetCurrentNetworkName();
            AppBuild    = Common.GetAppVersion();

            AzureHub      = IoTHubService?.HostName ?? Common.GetLocalizedText("NotAvailable");
            AzureDeviceId = IoTHubService?.DeviceId ?? Common.GetLocalizedText("NotAvailable");

            var networkInfoList = await NetworkPresenter.GetNetworkInformation();

            if (networkInfoList != null)
            {
                NetworkCollection.Clear();
                foreach (var network in networkInfoList)
                {
                    NetworkCollection.Add(new NetworkInfoDataTemplate(network));
                }
                return(true);
            }
            return(false);
        }