0
votes

I have a list on my view model that contains an object and property that I am trying to bind to from the main view.

var field = new UITextField();
Add(field);

this.AddBindings(
    new Dictionary<object, string>()
    {
        { field, "Text Names[0].Value" }
    }
);

This will load fine and display the initial value from the view model but won't receive any values back when UITextField.Text is modified. It seems like it is not 2 way. Value is not a notification property but could be made into one if that is what this setup requires.

I also tried the following but that does work at all:

set.Bind(field).To(vm => vm.Names[0].Value);

Using MvvmCross 3.0.9. Xamarin.iOS 6.3.7

1

1 Answers

0
votes

I've just tested this using 3.0.9 with a ViewModel which has an ObservableCollection of non-INPC Thing objects and this two way binding seems to work OK for me - both when the ObservableCollection changes and when the UITextField value changes because of user action.

Can you provide any more of your ViewModel nad list object code? (If not, can you reproduce the error in a simple sample?)

Can you provide any error trace you are seeing (in debug|output)? (This may need enabling - see MvvmCross Mvx.Trace usage)

Can you provide any more information on the form that "does work at all" - this might be a clue about what is going wrong.