问题
I have one custom object in my ViewModel.I want to bind only one of its member to textview in my droid view.
I want to bind only string member of that object to textview Currently I am doing this.
local:MvxBind = "Text Myobject.ItsMember"
Is it ok? Or am I wrong?
Or Can I do Like this?
local:MvxBind = "ItemsSource MyObject ; Text ItsMember"
How can I achieve this?
回答1:
local:MvxBind = "Text MyObject.ItsMember" is perfectly fine. Just make sure your spelling and capitalization are correct. Also, ItsMember should be a string or have a valid value returned as ToString.
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
local:MvxBind="Text MyObject.ItsMember"
/>
来源:https://stackoverflow.com/questions/21137544/bind-data-of-custom-object-to-textview-in-mvvmcross