x'}
vall ogin : commandbybindcommand (log in ) ) {params,canExecute-
//登录处理
}
}
viewmodelpropertydependsonotherproperties
//nameandpricepropertywillbeupdatedwhennewstockisset
classtockviewmodel (: viewmodel ) {
varstock:Stock? bybindProperty('stock ' )
valname :字符串? bybindProperty('name ',' stock ' ) {stock! name}
val price : floatbybindproperty (' price ',' stock ' ) {stock! price}
}
Wait/Until
//wait/untiljustlikeonetimebinding,butitneedapplyaction,forexamplebelow,itwaitformarketfrommodel,thendecidehowtoding
relativeLayout{
wait{until('market ',converter=viewOfMarket ) (inflate ) it,this@verticalLayout ) }
}
扩展绑定属性(dependonrxbindingheavily ) )。
事件
funview.click(path:string ) : property binding=command binding (path,clicks ),enabled ) )
属性
fun view.enabled (vararg paths : string,mode : one way=binding mode.one way,converter 3360 one way converter=emptyonewer
//thisimplementsfourbindingmodefortextview,ifjustneedOneWaymode,removelastthreelines,someforothermode
fun textview.text (vararg paths : string,mode : one way=binding mode.one way,converter 3360 one way converter=emptyoner )
fun textview.text (vararg paths : string,mode:OneTime,converter 3360 one way converter=emptyonewayconverter () ) ) 330
fun textview.text (path : string,mode:qpdzt,converter 3360 one way converter=emptyonewayconverter ) 3360属性
fun textview.text (path : string,mode:TwoWay,converter 3360 two way converter=emptytwowayconverter () ) 3360属性
Using with mmdmj/p dependencies{
compile ' com.benny.k binding : library :0.1.0 ' }
Contribute
nowisjustthebeginningofkbinding,soeveryoneinterestedinthislibrary,justforkitandpullrequeststome.let ' smakeitalitalittttlebettttttte
距离
QQ Group: 516157585