UserDialog进度条未显示

时间:2018-04-26 16:46:47

标签: c# xamarin mvvmcross

我正在尝试在网络操作期间显示进度条,但它不会递增。它保持2。

enter image description here

public async Task SyncPopulationDataAsync(string countryId)
{
    var cancelled = false;

    using (var dlg = Mvx.Resolve<IUserDialogs>().Progress("Test Progress", () => cancelled = true))
    {
        while (dlg.PercentComplete < 100)
        {
           dlg.PercentComplete += 2;
           await Task.Run(() => SyncPopulationData(countryId)).ConfigureAwait(false);
        }
     }
}

0 个答案:

没有答案