declex icon indicating copy to clipboard operation
declex copied to clipboard

Add manuel linking to ViewModel-like views

Open smaugho opened this issue 6 years ago • 0 comments

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.

smaugho avatar Jan 22 '18 16:01 smaugho