locked
Xamarin.Forms, MVVM and MVC RRS feed

  • Question

  • User386876 posted

    I'm new to Xamarin.Form. What does folks generally use in Xamarin.Forms apps - MVVM or MVC? I know MVC in asp.net environment. I see so many references to MVVM in Xamarin.Form than MVC in Xamarin.Forms, is MVVM a preferred architecture in Xamarin.Forms? Is it true that in MVVM, controller is replaced by VM?

    Hoping someone will shed some light.

    Wednesday, April 22, 2020 8:15 PM

Answers

  • User2148 posted

    xamarin forms has mvvm integrated, but there are also some mvc projects

    https://github.com/adospace/reactorui-xamarin https://github.com/Clancey/Comet

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, April 22, 2020 8:25 PM
  • User371688 posted

    is MVVM a preferred architecture in Xamarin.Forms?

    MVVM and MVC each have their advantages and disadvantages, but their usage scenarios are different. We can choose different architecture according to different requirements.

    If you're using Xamarin Forms, MVC makes no sense because XAML supports View Model binding.

    From official document The Model-View-ViewModel Pattern,we can know

    The Model-View-ViewModel (MVVM) pattern helps to cleanly separate the business and presentation logic of an application from its user interface (UI). Maintaining a clean separation between application logic and the UI helps to address numerous development issues and can make an application easier to test, maintain, and evolve. It can also greatly improve code re-use opportunities and allows developers and UI designers to more easily collaborate when developing their respective parts of an app.

    So, it is true that the controller is replaced by VM.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, April 23, 2020 9:18 AM

All replies

  • User2148 posted

    xamarin forms has mvvm integrated, but there are also some mvc projects

    https://github.com/adospace/reactorui-xamarin https://github.com/Clancey/Comet

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, April 22, 2020 8:25 PM
  • User371688 posted

    is MVVM a preferred architecture in Xamarin.Forms?

    MVVM and MVC each have their advantages and disadvantages, but their usage scenarios are different. We can choose different architecture according to different requirements.

    If you're using Xamarin Forms, MVC makes no sense because XAML supports View Model binding.

    From official document The Model-View-ViewModel Pattern,we can know

    The Model-View-ViewModel (MVVM) pattern helps to cleanly separate the business and presentation logic of an application from its user interface (UI). Maintaining a clean separation between application logic and the UI helps to address numerous development issues and can make an application easier to test, maintain, and evolve. It can also greatly improve code re-use opportunities and allows developers and UI designers to more easily collaborate when developing their respective parts of an app.

    So, it is true that the controller is replaced by VM.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, April 23, 2020 9:18 AM
  • User371688 posted

    @joegreen Hi friend, how are you doing? I’m writing to check if provided information is helpful. Please let me know if you need further assistance. Thank you.

    Tuesday, April 28, 2020 6:36 AM