Mvvmcross Two-way binding between custom properties

Viewed 1135

I can't understand, how can I bind two custom property between View and ViewMode with Two-Way mode. First I have a same ViewModel like:

//ViewModel
    public class MyViewModel : MvxViewModel
    {
    ....

    private MyMode _testA

    public MyMode TestA
    {
        get => _testA;
        set { 
            _testA = value;
            RaisePropertyChanged(()=> TestA);
            }
    }


        public  MyViewModel()
        {
            TestA = MyMode.A;
        }

            ........
    }

And in View I do bind with my custom property:

//View
 public partial class MyView : MvxViewController<MyViewModel>
 {

    public MyMode UiTestA

     private void SetBiding()
        {
            var set = this.CreateBindingSet<MyView, MyViewModel>();
            set.Bind(this).For(x => x.UiTestA()).To(vm => vm.TestA);
            set.Apply();
        }

    private void SomeMethod()
        {
            var t1 = UiTestA; // t1 = MyMode.A;
            UiTestA = MyMode.B; // Two way binding?
            var t2 = ViewModel.TestA; // MyMode.A; 
        }
 }

If I change TestA in ViewModel, I can get this in View, but I want change it in View and find new value in ViewModel.

1 Answers
Related