xamarinxamarin.formsxamarin.iosfreshmvvm

What is the difference between PushPageModel and PushPageModelWithNewNavigation while using FreshMVVM?


I need new navigation page using FreshMVVM .While using the PushPageModelWithNewNavigation the view size is changed but it is perfect while using PushPageModel. Kindly suggest a solution or explain the difference between the two?

public class PageModel : FreshBasePageModel
{
    public Command GoToDoc => new Command(async () => await GoToViewer());
    public Command GoToPage => new Command(async () => await GoToNewMain());

    private async Task GoToViewer()
    {
          await CoreMethods.PushPageModelWithNewNavigation<PdfViewPageModel>(null, true);


    }

    private async Task GoToNewMain()
    {
        await CoreMethods.PushPageModel<PageModel>(null, false, true);
    }

Solution

  • In FreshMvvm PushPageModelWithNewNavigation is starting new NavigationStack unlike PushPageModel. If you use PushPageModelWithNewNavigation with TabbedPage or ContentPage, It would show you new screen without child Tabs & Backarrow on top. But you can have your custom button to close this top page.

    As you have method GoToViewer(), It would start a new Page as viewer without having Tabs or arrow on action bar.