Forum Xamarin.Android

[MVVMLight] Both the ValueChanged event and .WhenSourceChanges() event get triggered twice

I'm using MVVMLight and both the ValueChanged event and .WhenSourceChanges() event get triggered twice for the property I am binning on my viewmodel. The property in my viewmodel looks as below, and I break point the set {} bit and the value is definitely being updated once only, but ValueChanged gets triggered twice.


Binding in Android Activity:


this.SetBinding(
() => this.Vm.IsPinCorrect).ValueChanged += PinLoginActivity_ValueChanged;


Property in PCL Viewmodel:


   public bool IsPinCorrect
    {
        get
        {
            return this.isPinCorrect;
        }

        set
        {
            if (this.Set(() => this.IsPinCorrect, ref this.isPinCorrect, value))
            {
                this.RaisePropertyChanged();
            }
        }
Sign In or Register to comment.