Sunday, April 3, 2016

FreshMVVM getting started the missing step

I have been playing around with FreshMVVM and found I like it a lot. It is very light weight and fairly easy to use.
There is one thing missing from the FreshMVVM quick start that I felt should blog about. You need to put everything in a fresh navigation container if you want the pages and page models to resolve and of course be able to navigate.
http://www.michaelridland.com/xamarin/freshmvvm-quick-start-guide/
In the app class this is how you need to set MainPage to an instance to show the first page.

    public App()
    {
        // The root page of your application
        var homePage = FreshMvvm.FreshPageModelResolver.ResolvePageModel<HomePageModel>();
        var navConatiner = new FreshMvvm.FreshNavigationContainer(homePage);
        MainPage = navConatiner;
    }

2 comments:

  1. This is just perfect and EXACTLY what is missing

    ReplyDelete
  2. Thanks for posting this. I knew I was missing something.

    ReplyDelete