예제 #1
0
        private async Task LoadSurveys()
        {
            List <Survey> sur = await api.Backend.GetSurveysAsync(cid);

            Surveys      = SurveyCellViewModel.CreateViewModels(sur, CellBackgroundColor);
            IsRefreshing = false;
        }
예제 #2
0
 protected void refreshWork()          // TODO test this
 {
     try {
         while (true)
         {
             // Wait 30 sec.
             Thread.Sleep(60 * 1000);
             List <Survey> sur = api.Backend.GetSurveysAsync(cid).Result;
             if (sur.Count != Surveys.Count)
             {
                 Surveys = SurveyCellViewModel.CreateViewModels(sur, CellBackgroundColor);
             }
         }
     } catch (Exception ex) {
         // just die... TODO do something about it
     }
 }