我正在尝试在网络操作期间显示进度条,但它不会递增。它保持2。
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);
}
}
}