public void Refresh() { InvokeOnMainThread(LoadingIndicator.Instance.StartLoading); model.Load(() => { InvokeOnMainThread(UpdateUI); InvokeOnMainThread(LoadingIndicator.Instance.StopLoading); }); }
public void Refresh() { model.Load(() => ((Activity)Context).RunOnUiThread(() => { Redraw(); OnDescriptionChanged(new EventArgs()); })); _lastRefreshTime = DateTime.Now; }
public void LoadData() { IsLoading = true; model.Load(() => Deployment.Current.Dispatcher.BeginInvoke(() => { if (model.LoadError) { DaysLeft = 0; DaysLeftSuffix = ""; UntillText = "Failed to load project info from server"; } else { DaysLeft = model.DaysLeft; DaysLeftSuffix = model.DaysLeftText; UntillText = model.UntillText; } IsLoading = false; })); }
public void Should_return_the_correct_suffix_for_positive_number_of_days(int days, string expected) { SetServiceData(days, new DateTime(2000, 1, 1)); model.Load(() => { }); Assert.AreEqual(expected, model.DaysLeftText); }