Exemplo n.º 1
0
        void makeData()
        {
            try
            {
                string url = App.BaseURL + "AppArray/GetAllArray?id=" + _arrayID + "&pageIndex=0&pageSize=30";
                Console.WriteLine(url);
                string result = EasyWebRequest.sendGetHttpWebRequest(url);
                Console.WriteLine("请求结果:" + result);
                devisResult dev = JsonConvert.DeserializeObject <devisResult>(result);
                if (pageIndex == 0)
                {
                    dataList.Clear();
                }
                if (dev.Items.Count < 20)
                {
                    haveMole = false;
                }

                for (int i = 0; i < dev.Items.Count; i++)
                {
                    DeviesModel item = dev.Items[i];

                    dataList.Add(item);
                }
            }
            catch (Exception ex)
            {
                DisplayAlert("错误提示", ex.Message, "OK");
            }
        }
Exemplo n.º 2
0
        void Handle_ItemAppearing(object sender, Xamarin.Forms.ItemVisibilityEventArgs e)
        {
            DeviesModel item = e.Item as DeviesModel;

            if (item == dataList[dataList.Count - 1] && haveMole == true && item != null)
            {
                pageIndex += 1;
                addMoreData();
            }
        }