Jim Wilcox
Jim Wilcox

Reputation: 1573

Binding to DataModel in MVVMCross

I have done the intro tutorial online and it works. My question is how does Mvvmcross know which View to associate with the ViewModel? There is nothing I can see in the code where they reference each other.

Upvotes: 0

Views: 50

Answers (1)

xleon
xleon

Reputation: 6365

The default mode is by naming convention. If your view is called "AwesomeView", Mvx will assign "AwesomeViewModel" to it at the app initialization.

When your view is instantiated, Mvx will "inject" the dependency (ViewModel) into your view as a binding context

So the convention to look up the view model is [ViewName]Model If I´m correct this works using reflection

Upvotes: 1

Related Questions