Google News
logo
Xamarin - Interview Questions
What is Fresh Model-View-ViewModel (MVVM)?
FreshMvvm is a super light Mvvm Framework designed specifically for Xamarin.Forms only. It's designed to be Easy, Simple and Flexible. It is easy to learn and uses convention over configuration.

Fresh MVVM deviates a little from MVVM as it uses the concept of Page and PageModel instead of View and ViewModel.

The various features of Fresh MVVM are :
* Every Page must be associated with a Page Model
* The PageModel can have an Init method to initialize Model variables and a ReversInit() method (a destructor) that is called when a model is popped with object
* Page Model allows dependencies to be automatically injected into the Constructor
* A Page must have a corresponding PageModel, with naming important so an ImagePageModel must have an ImagePage
* PageModel can have dependencies automatically injected into the Constructor
* The navigation in Fresh MVVM takes place between Page Models.
* Supports automatic wiring of BindingContext
* Supports automatic wiring of Page events (eg. appearing)
* FreshMvvm comes with a built-in Inversion of Control Container
* Page Model Important Methods :
* Init() : The Init() method is called when the page is about to be loaded. User can pass an "object" to this method to allow setting up the Page with external data before it is being loaded
* ReversInit() : The ReverseInit()  method is called when the page I about to be popped from the stack. It allows returning an "object" which can contain the data returned by the Page
* ViewIsDisappearing() : ViewisDisappearing() is called when the view is about to disappear from the screen
* ViewIsAppearing() : ViewisIsAppearing() is called when the view is about to appear on the screen.
Advertisement