Forum Xamarin.Forms

OnElementPropertyChanged only fires once

MehdyMehdy USMember
edited September 2015 in Xamarin.Forms

I have this bindable property for my custom renderer , when I change the property for the first time
OnElementPropertyChanged in custom renderer gets fired but on next change it doesn't fire.
any idea about why it works only once?

public static readonly BindableProperty NumberProperty = BindableProperty.Create<MyView, string>(p => p.Number, null,BindingMode.TwoWay);

public string Number { get { return (string)GetValue(NumberProperty ); } set { SetValue (NumberProperty, value); } } // it would rise ElementPropertyChanged event}

and in my custom renderer

protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) { // handle elemnt property change }


  • MehdyMehdy USMember

    my mistake, I was trying to trigger change with another property name GUID with new guid.ToString(); which always creates an empty guid, changing it to Guid.NewGuid ().ToString (); fixed the issue.

Sign In or Register to comment.