C# Xamarin Modal don';等不及了
我试图在我的应用程序中插入一个模式页面 现在我举一个例子。只是一个例子C# Xamarin Modal don';等不及了,c#,xamarin,modal-dialog,C#,Xamarin,Modal Dialog,我试图在我的应用程序中插入一个模式页面 现在我举一个例子。只是一个例子 await this.Navigation.PushModalAsync(new MyModalPage()); await this.Navigation.PushModalAsync(new LoginPage()); 我不明白为什么我的应用程序在myModalpage加载后不等待。 我还尝试插入一个 wait displayalert(..)第二行之后的行PushModalAsync 我不必等待就能看到这个警报。正如
await this.Navigation.PushModalAsync(new MyModalPage());
await this.Navigation.PushModalAsync(new LoginPage());
我不明白为什么我的应用程序在myModalpage
加载后不等待。
我还尝试插入一个wait displayalert(..)
第二行之后的行PushModalAsync
我不必等待就能看到这个警报。正如奇塞巴隆所说:
API不是这样工作的。事情一做完就继续
推
这个方法确实在等待,我认为它执行得太快了,以至于你觉得它没有等待
您可以添加一些自定义延迟来降低速度。它只等待页面弹出
public async void test()
{
await Task.Delay(1000);
await this.Navigation.PushModalAsync(new Page1());
await Task.Delay(2000);
await this.Navigation.PushModalAsync(new Page1());
}
你希望它等到模态被解除吗?API不是这样工作的。一旦完成,它就会继续。