MvvmLight binding stops working on one of the directions. Binding edittext of textinputlayout.

Pedro_MonizPedro_Moniz Member ✭✭
edited January 28 in Xamarin.Android

Hello, I am having an issue with a binding that is killing me.

On my fragment I have

_viewModel.NameEntry = "test";
_bindings.Add(this.SetBinding(() => _viewModel.NameEntry, () => EditProfileTextInputLayout.EditText.Text, BindingMode.TwoWay));

When I open the "test" appears so it is working.

However, when I change the NameEntry on my viewmodel, the binding is not called and the UI is not updated.
I know the binding is still working because when I write on the edittext it triggers the NameEntry setter.

It is as if, apart from the initialization, the bindingmode.TwoWay does not work.

Anyone has any suggestions?

Edit: Just forgot the setter from viewmodelbase.

Best Answer

  • Pedro_MonizPedro_Moniz ✭✭
    Accepted Answer

    I just made a dumb mistake on my property setter.

    Forgot the Set method from viewmodelbase

Answers

  • Pedro_MonizPedro_Moniz Member ✭✭
    Accepted Answer

    I just made a dumb mistake on my property setter.

    Forgot the Set method from viewmodelbase

Sign In or Register to comment.