DSpotDevelopers / declex

DecleX - Declarative Framework for Android, easier and faster coding.
Other
168 stars 25 forks source link

Add manuel linking to ViewModel-like views #234

Open smaugho opened 6 years ago

smaugho commented 6 years ago

Right now ViewModels are linked automatically by DecleX, but some times it could be useful (and informative) to link manually the ViewModel and the view, in the simple possible way.

A simple way to do this, is to make the populate methods or any view-linking (@Click or similar annotation) to create a "linking" method, this will be used only in the "@Export" behavior.

you can link the view model then to the view through methods, or assigns..

viewModel.linkGetUserName(R.id.userName);
viewModel.linkSomePopulatorMethodOrProperty(R.id.someId);

DecleX automatically could do this, but when the programmer do it, then it is not used the one done by DecleX.