コード例 #1
0
        public void GetAds()
        {
            var mth = new GetADs()
            {
                Type = AdTypes.MobileAdMiddle
            };

            var datas = ApiClient.Instance.Value.Execute(mth).Result;
        }
コード例 #2
0
        private async Task LoadAds()
        {
            var mth = new GetADs()
            {
                AllowCache = true,
                Type       = AdTypes.MobileAdMiddle
            };
            var datas = await ApiClient.ApiClient.Instance.Value.GetDataFromCache(mth);

            if (datas == null)
            {
                datas = await ApiClient.ApiClient.Instance.Value.Execute(mth);
            }
            this.AdImgs = new ObservableCollection <Ad>(datas);
            this.NotifyOfPropertyChange(() => this.AdImgs);
        }