Unable to properly push a child page to master detail

aliasx9aliasx9 Member ✭✭

I am following the example here: [the forums] /discussion/41420/navigate-programmatically-from-one-detail-page-to-another-masterdetailpage (Because I'm not allowed to post links) and although it works when I want the new page to be a top level page, I am having trouble making it a child or sub-page of another. I thought if I used
masterDetail.Navigation.PushAsync(new NavigationPage(viewProfile));
instead of
masterDetail.Detail = new NavigationPage(viewProfile);
masterDetail.IsPresented = false; (which still works but appears as a top level detail page)

that it would create the child page I was looking for but instead it just does nothing. I looked at the masterDetail information page and googled around for a solution but I haven't been able to get a good understanding on why it's not working.

Best Answer

  • aliasx9aliasx9 ✭✭
    Accepted Answer

    Thanks Darshan, that didn't work but I got it working through taking the Navigation and pushing my page onto that with async.

Answers

  • DarshanJSDarshanJS USMember ✭✭✭✭
    edited March 2018

    @aliasx9 said:
    I am following the example here: [the forums] /discussion/41420/navigate-programmatically-from-one-detail-page-to-another-masterdetailpage (Because I'm not allowed to post links) and although it works when I want the new page to be a top level page, I am having trouble making it a child or sub-page of another. I thought if I used
    masterDetail.Navigation.PushAsync(new NavigationPage(viewProfile));
    instead of
    masterDetail.Detail = new NavigationPage(viewProfile);
    masterDetail.IsPresented = false; (which still works but appears as a top level detail page)

    that it would create the child page I was looking for but instead it just does nothing. I looked at the masterDetail information page and googled around for a solution but I haven't been able to get a good understanding on why it's not working.

    Try this code
    App.Current.MainPage = new MenuPage { Detail = new NavigationPage(new HomePage()) };

  • aliasx9aliasx9 Member ✭✭
    Accepted Answer

    Thanks Darshan, that didn't work but I got it working through taking the Navigation and pushing my page onto that with async.

Sign In or Register to comment.