Example #1
0
 async Task <bool> RenewDailyUI(DailyModel model, DailyExtraModel modelEx)
 {
     if (model == null || modelEx == null || model.title == null)
     {
         return(await Task.FromResult(false));
     }
     return(await Task.Run(() =>
     {
         Title = model.title;
         CssFileName = "daily.css";
         HtmlBody = model.body.Replace("img-place-holder", "img-place-holder1");
         ProgressBarFinish();
         return true;
     }));
 }
Example #2
0
 public void GetDailyExtraSuccess(DailyExtraModel extra)
 {
     if (extra.popularity > 0)
     {
         txtGood.Text = extra.popularity.ToString();
     }
     if (extra.comments > 0)
     {
         txtComments.Text = extra.comments.ToString();
         (txtComments.Parent as FrameLayout).Click += delegate
         {
             DailyCommentActivity.Start(this, id.ToString());
         };
     }
 }
Example #3
0
        public override async Task InitializeAsync(object navigationData)
        {
            if (IsInitialize == true)
            {
                return;
            }
            model = await dailyPresenter.GetClientDaily(Id);            //从本地数据库获取

            modelEx = await dailyPresenter.GetClientDailyExtra(Id);     //从本地数据库获取

            IsProgressing |= await RenewDailyUI(model, modelEx) == false;

            ProgressBarRunning();
            if (model.title == "" || model.updatetime.AddMinutes(15) < DateTime.Now)
            {
                model = await dailyPresenter.GetServiceDaily(Id);

                modelEx = await dailyPresenter.GetServiceDailyExtra(Id);
                await RenewDailyUI(model, modelEx);

                IsProgressing = false;
            }
            IsInitialize = true;
        }