You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to build up a navigation stack and pushing from a Page that has a NavigationPage parent, the pages are added in the incorrect order, and the middle page is broken.
Given the following example, the expectation is that the final navigation stack would be: ViewA/ViewB/ViewC
Unfortunately the result is ViewA/ViewC/ViewB. Notice that page that should be last is in the middle. Not only that, but ViewC is completely broken and no bindings are retained. Not to mention all the Titles are messed up and are showing the wrong values.
public partial class App : Application
{
public App()
{
MainPage = new NavigationPage(new ViewA());
}
}
public class ViewA : ContentPage
{
public ViewA()
{
Title = "View A";
Button btn = new Button() { Text = "Navigate from ViewA", HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center };
btn.Clicked += Btn_Clicked;
Content = btn;
}
private async void Btn_Clicked(object sender, System.EventArgs e)
{
var viewB = new ViewB();
var viewC = new ViewC();
await viewB.Navigation.PushAsync(viewC);
await Navigation.PushAsync(viewB);
}
}
public class ViewB : ContentPage
{
public ViewB()
{
Title = "View B";
Content = new Label() { Text = "View B" };
}
}
public class ViewC : ContentPage
{
public ViewC()
{
Title = "ViewC";
Content = new Label() { Text = "ViewC" };
}
}
The text was updated successfully, but these errors were encountered:
currently I have temporary resolved this issue with separate navigation to the middle page, then from the middle page I'm navigating to the last page inside OnNavigatedTo method for the middle page. Also need to set useModalNavigation flag to false for the transition on a last page
This is a Xamarin.Forms bug and we are awaiting a fix: https://bugzilla.xamarin.com/show_bug.cgi?id=56593
When trying to build up a navigation stack and pushing from a Page that has a NavigationPage parent, the pages are added in the incorrect order, and the middle page is broken.
Given the following example, the expectation is that the final navigation stack would be: ViewA/ViewB/ViewC
Unfortunately the result is ViewA/ViewC/ViewB. Notice that page that should be last is in the middle. Not only that, but ViewC is completely broken and no bindings are retained. Not to mention all the Titles are messed up and are showing the wrong values.
The text was updated successfully, but these errors were encountered: