locked
Exception: PushAcsync is not supported, use NavigationPage RRS feed

  • Question

  • User243969 posted

    Hello, am working with MVVM, get/post to cunsume WS API i am facing an exception in this line: await App.Current.MainPage.Navigation.PushAsync(new TimelinePage(res2.result.token));

    Thanks in advance

    Saturday, April 8, 2017 5:02 PM

Answers

  • User243969 posted

    this worked for me :

    App.Current.MainPage = new NavigationPage(displayPage);

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Sunday, April 9, 2017 5:42 PM

All replies

  • User37696 posted

    @RefkaBenmahmoud,

    This is most likely because the MainPage is not a child of a NavigationPage.

    You'll have to do something like this in your App class.

    MainPage = new NavigationPage(new MyPage());
    

    The important point is that your page is wrapped with a NavigationPage. More info on getting started with this is here.

    Saturday, April 8, 2017 5:44 PM
  • User243969 posted

    @JohnMiller i am redirecting from a RestClient class, not the App class

    Sunday, April 9, 2017 11:59 AM
  • User243969 posted

    this worked for me :

    App.Current.MainPage = new NavigationPage(displayPage);

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Sunday, April 9, 2017 5:42 PM