mvvmcross ios method binding (RIO) -
is there way achieve method binding in ios mvvmcross ? cannot see example of such binding in vids or tutorials...
imagenavigationviewmodel:
public void navigateleft() { if (!this.hasleftsisters.value) { return; } this.currentnodeindex--; this.update(); }
imagenavigationview:
private uibutton navigateleftbutton; ... var set = this.createbindingset<imagenavigationview, imagenavigationviewmodel>(); set.bind(this.navigateleftbutton).to(vm => vm.navigateleft);
i have compile-time error since it's expecting object (icommand).
i tried too:
set.bind(this.navigateleftbutton).to("navigateleft");
and have runtime error: failed create target binding binding touchupinside navigateleft.
i ended adding icommand view model, bit disappointing since "method bind" find in android.
rio method binding available in ios
it's demonstrated in https://www.youtube.com/watch?v=8-5xqlcvj2y sample cod ein https://github.com/mvvmcross/nplus1daysofmvvmcross/blob/master/n-36-rio/bindme.touch/views/firstview.cs#l58
your line:
set.bind(this.navigateleftbutton).to("navigateleft");
should work - need method binding plugin added touch ui project enable extension.
Comments
Post a Comment