Xamarin表单:导航堆栈的顺序错误
我的导航堆栈有问题 我有三个页面,在第一个页面中,我有一个PushAsync到OnAppearing触发器中的第二个页面。第二个页面与构造函数中的第三个页面有一个PushAsync 这就是堆栈的外观: 第1页>第2页>第3页 但是,堆栈看起来是这样的 第1页>第3页>第2页 所以我的问题是,在构造函数中调用pushasync还是不调用它。Xamarin表单:导航堆栈的顺序错误,xamarin,xamarin.forms,Xamarin,Xamarin.forms,我的导航堆栈有问题 我有三个页面,在第一个页面中,我有一个PushAsync到OnAppearing触发器中的第二个页面。第二个页面与构造函数中的第三个页面有一个PushAsync 这就是堆栈的外观: 第1页>第2页>第3页 但是,堆栈看起来是这样的 第1页>第3页>第2页 所以我的问题是,在构造函数中调用pushasync还是不调用它。 我还处于开始阶段,所以我不知道该做什么和不该做什么。您很可能没有等待推送方法,这就是为什么您的导航堆栈中可能有错误的顺序: await Navigation.
我还处于开始阶段,所以我不知道该做什么和不该做什么。您很可能没有等待推送方法,这就是为什么您的导航堆栈中可能有错误的顺序:
await Navigation.PushAsync(new YourPage());
您很可能没有等待推送方法,这就是为什么导航堆栈中的顺序可能错误:
await Navigation.PushAsync(new YourPage());
您不能在构造函数中给出wait运算符,所以要获得结果,您可以这样做
Public Constructor()
{
Doit();
}
public async void Doit()
{
// In fisrt page insert second page..
//In second page too do the same while inserting third Page
await await Navigation.PushAsync(new YourPage());
}
您不能在构造函数中给出wait运算符,所以要获得结果,您可以这样做
Public Constructor()
{
Doit();
}
public async void Doit()
{
// In fisrt page insert second page..
//In second page too do the same while inserting third Page
await await Navigation.PushAsync(new YourPage());
}