MVVMCross How is this view related to ViewModel?

I am trying to understand why I get an error message that I can’t find the correct ViewModel when I launch the iOS application.

I have a question when I look at this example . I do not understand where MainMenuView binds to MainMenuViewModel.

Can someone answer this to me?

Thanks,

Pkl728

+6
source share
4 answers

They are connected by class names: for XXXView, XXXViewModel must match

+7
source

I just want to add to the answer: double-check the view names after renaming (even renaming Resharper is not perfect). Several tens of minutes passed (and beer), catching a similar error MvvmCross Could not find view for %ViewModelName% .

+1
source

For those who end up here with the same problem as me. I was getting this error in an Android project because my (properly named) view extended Activity, not MvxActivity (this happens easily when you use the Xamarin Studio function “Add Android Activity”)

+1
source

I get this from a project that I just upgraded to MvvmCross 4. I don’t have much experience with MvvmCross, and the project has not been supported for several years, so maybe something else is wrong.

I ended up hardcoding the mappings in Setup :: InitializeViewLookup because I don't have time to spend on it anymore.

0
source

Source: https://habr.com/ru/post/949267/


All Articles