Recommendations for an MVVM Framework for Xamarin.Forms

FaisalGFaisalG GBMember ✭✭

Folks

Any recommendations for a MVVM Framework designed for Xamarin.Forms which is ViewModel-centric?

I only know of two but neither of them really fit my needs:

1) FreshMvvm is PageModel-centric. Perhaps it should be called FreshMvvp?

2) MvvmCross is, from my understanding, really designed for Xamarin Classic and supplies many features that are already baked into Xamarin.Forms.

Best Answer

  • RHudsonRHudson CA ✭✭✭
    edited August 2016 Accepted Answer

    Yes, it's a semantics confusion. But the current version allows you to interchange the terms 'view' and 'page'

    BTW, as a plug for Michael, I use FreshMvvm in all my projects and it works great.

Answers

  • AndrewRobertsAndrewRoberts USMember ✭✭

    FreshMvvm supports the ViewModel naming extension out of the box. Also supports any custom naming convention you'd like.

  • RHudsonRHudson CAMember ✭✭✭

    @FaisalG I'm curious, why doesn't FreshMvvm fit your needs?

    What's missing, or what need do you have that the framework doesn't handle?

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Xamarin.Forms already is MVVM ready. I'm curious what you're lacking in the built-in support that you have to go look for another.

  • FaisalGFaisalG GBMember ✭✭

    @RobertHudson.0264 I may be wrong, but I was under the impression that FreshMvvm uses View-First navigation rather than ViewModel-first navigation.

    Looking at the docs as detailed here:
    https://github.com/rid00z/FreshMvvm

    I was thrown by the use of "PageModel" to refer to ViewModel and I thought this was a View-First navigation system.

    Upon closer inspection, it looks like the author uses the term "PageModel to PageModel navigation" and he is using the word PageModel to refer to ViewModel. Since he uses XAML pages for the views, the use of "PageModel" to replace "ViewModel" is therefore correct.

    So this is indeed a ViewModel-first navigation system.

  • RHudsonRHudson CAMember ✭✭✭
    edited August 2016 Accepted Answer

    Yes, it's a semantics confusion. But the current version allows you to interchange the terms 'view' and 'page'

    BTW, as a plug for Michael, I use FreshMvvm in all my projects and it works great.

  • FaisalGFaisalG GBMember ✭✭

    I may just stick to the Ninject-based MVVM solution detailed by Ed Snider in his book 'Mastering Xamarin.Forms'. It has all the features, is very lightweight and is not that much of an overhead to roll your own.

  • MichaelRidlandMichaelRidland AUInsider, University ✭✭✭
    edited August 2016

    Here's some info on recent releases of FreshMvvm.
    http://www.michaelridland.com/xamarin/announcing-freshmvvm-2-0/
    http://www.michaelridland.com/xamarin/announcing-freshmvvm-2-1-and-2-2/

    FreshMvvm is specifically designed for Xamarin.Forms. It was built with some of the early version of Xamarin.Forms and used in a very large amount of production apps. The basics of the Framework are similar to other Frameworks, IOC, DI, ViewModel navigation.

    It's heavily used in many production apps, we use it internally and continually add features that are important for Xamarin projects. It has no dead ends in Forms projects, it's got flexibility to implement anything that Forms can do. One of it's biggest strengths is the built in NavigationContainers and the abstractions that allow you to implement your own Navigation containers. It's also easy to get started.

    That's about it. You can read more on the website. https://github.com/rid00z/FreshMvvm/blob/master/README.md

    There's also more video that you can watch.

    FreshMvvm n=0 – Mvvm in Xamarin.Forms and Why FreshMvvm

    FreshMvvm n=1 : Your first FreshMvvm Application

    FreshMvvm n=2 – IOC and Constructor Injection

    FreshMvvm n=3: Navigation in FreshMvvm

    Implementing custom navigation in FreshMvvm for Xamarin.Forms

  • muhammetsahinmuhammetsahin TRMember ✭✭

    I recommend you to using Prism Forms which is release 6.2.0 some great features.

    I really like navigation service like url.

    public class App : PrismApplication { protected override void OnInitialized() { NavigationService.Navigate("MainPage"); } protected override void RegisterTypes() { Container.RegisterTypeForNavigation<MainPage>(); } }

    //relative _navigationService.Navigate(new Uri("MainPage", UriKind.Relative)); //absolute _navigationService.Navigate(new Uri("http://www.brianlagunas.com/MainPage", UriKind.Absolute));

    Greate presentation video:
    https://evolve.xamarin.com/session/56e2211afd00c0253cae33a9

    https://github.com/PrismLibrary/Prism

  • RobinSchroeder.8683RobinSchroeder.8683 USMember ✭✭
    I loved Ed Snider's book. I use that ninject ioc container with XAML and MVVMLight's vmbase and relay command. I love mvvm light because you an use it just as you need. Also there is Andy Pedley's Exrin, but I haven't had time to look at it in detail.
Sign In or Register to comment.