monotouch - MvvmCross - How to bind UIView.Layer.AnyProperty (Xamarin.iOS) to a property on a viewmodel? -
monotouch - MvvmCross - How to bind UIView.Layer.AnyProperty (Xamarin.iOS) to a property on a viewmodel? -
i have property on view model called bordercolor of type string, , seek bind uiview.layer.bordercolor, here's binding sytax:
set.bind (this.myuiview).for ("layer.bordercolor").to (t => t.bordercolor).withconversion (new stringtocolorconverter { tocgcolor = true });
it doesnt work, however, if bind backgroundcolor property straight on uiview, works charm. knows if binding layer property supported mvvmcross?
i tried different variations of target path, "layer.bordercolor", , typed t=>layer.bordercolor, no luck.
from description of fluent binding syntax @ https://github.com/mvvmcross/mvvmcross/wiki/databinding#fluent
the fluent syntax provides c# way create bindings.
this syntax done using createbindingset helper.
the syntax includes:
bind($viewobject$)
where $viewobject$ view target binding.
for(v => v.$viewproperty$)
where $viewproperty$ property on view binding.
so ... seek using:
set.bind (this.myuiview.layer).for ("bordercolor")...
this should work long no-one changes layer
- if need more complicated binding that, you'd need create custom binding (see examples in n+1 series).
ios monotouch xamarin mvvmcross
Comments
Post a Comment