Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVVMCross How does this View get linked to the ViewModel?

I'm trying to figure out why I get an error message about not being able to find the right ViewModel when I'm running my iOS app.

The question I have is when I look at this example I don't understand where MainMenuView gets bound to MainMenuViewModel.

Can someone answer this for me?

Thanks,

PkL728

like image 937
PkL728 Avatar asked Jul 11 '13 19:07

PkL728


People also ask

Can mvvmcross locate a ViewModel for a tipview?

MvvmCross can locate a ViewModel for a View as long as both members have the same root and suffixes View& ViewModel. In our case, MvvmCross will look for a TipViewModelfor TipView. More notes on this docs to be added!

What is viewmodellocator in MVVM?

In MVVM each View needs to be hooked up to its ViewModel. The ViewModelLocator is a simple approach to centralize the code and decoupling the view more.

Is there an alternative to mvvmcross?

There is an alternative however. If you don’t use generic parameters, then MvvmCross will make use of some built in “Convention over Configuration” to figure out how to link classes. MvvmCross can locate a ViewModel for a View as long as both members have the same root and suffixes View& ViewModel.

What are the different patterns of MVVM?

The MVVM Pattern 1 View. The view is responsible for defining the structure, layout, and appearance of what the user sees on screen. 2 ViewModel. The view model implements properties and commands to which the view can data bind to, and notifies the view of any state changes through change notification events. 3 Model. ...


1 Answers

They are bound by class names: for XXXView should be corresponded XXXViewModel

like image 195
Roman Kagan Avatar answered Sep 20 '22 07:09

Roman Kagan