Пример #1
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();
            PM25DataService service = new PM25DataService();
            var             result  = await service.GetDataFromOpenDataAsync();

            this.Pm25ItemsList.ItemsSource = result
                                             .FindAll(x => decimal.Parse(x.PM25) >= decimal.Parse("7")).ToList();
        }
Пример #2
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            if (!CrossConnectivity.Current.IsConnected)
            {
                //You are offline, notify the user
                DisplayAlert("Error", "無網路服務", "OK");
                return;
            }


            PM25DataService service = new PM25DataService();

            this.Pm25ItemsList.ItemsSource = await service.GetDataFromOpenDataAsync();
        }