我有以下代码:
System.Threading.Tasks.Task appointmentEndTask = App.ArdaBusinessLogic.AppointmentEnd(_appointment);
System.Threading.Tasks.Task appointmentEndCompletedTask = appointmentEndTask.ContinueWith(
async task =>
{
_appointmentDetailPage.IsDirty = true;
await App.MasterNavigationPage.Navigation.PopModalAsync();
},
System.Threading.CancellationToken.None,
System.Threading.Tasks.TaskContinuationOptions.OnlyOnRanToCompletion,
System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext());
System.Threading.Tasks.Task appointmentEndFaultedTask = appointmentEndTask.ContinueWith(
async task =>
{
await App.MasterNavigationPage.Navigation.PopModalAsync();
await App.ShowErrorPageAsync(task.Exception);
},
System.Threading.CancellationToken.None,
System.Threading.Tasks.TaskContinuationOptions.OnlyOnFaulted,
System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext());
因此,如果“AppointmentEnd”任务完成,则应关闭当前模态页面。有时(并非总是!)我在崩溃日志中收到以下错误。在本例中,第 139 行是“_appointmentDetailPage.IsDirty = true”之后的“await App.MasterNavigationPage.Navigation.PopModalAsync()”。
不幸的是,我不明白为什么会出现这个错误。你能帮助我吗?
慕斯709654
相关分类