Ejemplo n.º 1
0
        internal async void LoadDataCmdFunc()
        {
            LoadingActive = true;
            instance?.SingleList?.Clear();
            LoadDataCommon.InitData(PageIndex, PageCount, Tag1);
            totalClass t = await LoadDataCommon.LoadData();

            if (t != null && t.data.Count > 0)
            {
                t.data.ForEach((o) =>
                {
                    if (!string.IsNullOrEmpty(o.image_url))
                    {
                        BitmapImage bit = new BitmapImage(new Uri(o.image_url, UriKind.RelativeOrAbsolute));
                        instance.SingleList.Add(
                            new singleClassForPage()
                        {
                            Desc             = o.desc,
                            Image_data       = bit,
                            Thumbnail_height = 60,      //220,250
                            Thumbnail_width  = 60,
                            Image_url        = o.image_url
                        });
                    }
                });
            }
            instance.totalPage = t.totalNum;
            LoadingActive      = false;
        }
Ejemplo n.º 2
0
        public static async Task <totalClass> LoadData()
        {
            string result = "";
            string url    = string.Format(URL, pageIndex, pageCount, tag1);

            result = await GetGo.GetAsyncData(url);

            totalClass t = JsonConvert.DeserializeObject <totalClass>(result);

            return(t);
        }