1

I am using Realm and PropertyChanged Fody in my Xamarin Forms project. I have two models - Person and Friend which are like below. The person object has a reference to the friend object. I have binded the Age of the person and the friend to two separate labels. Now as I am using PropertyChanged Fody, whenever the Age changes it should update the labels. But only the first label (person's Age) updates, the second one(person's friend's Age) doesn't. How can I raise notifications when the age of the friend changes?

    [ImplementPropertyChanged]
    public class Person : RealmObject
    {
        public string Name { get; set; }
        public int Age { get; set; }
        public Friend friend { get; set; }
    }

    [ImplementPropertyChanged]
    public class Friend : RealmObject
    {
        public string Name { get; set; }
        public int Age { get; set; }
    }

I bind them in the Xaml like below.

    <Label Text="{Binding person.Age}" />
    <Label Text="{Binding person.friend.Age}" />
Ramaraj T
  • 5,184
  • 4
  • 35
  • 68

1 Answers1

0

You don't need PropertyChanged.Fody because Realm has notifications built in. My guess is it's interfering with Realm's logic because what you describe should just work.

Nikola Irinchev
  • 1,911
  • 1
  • 13
  • 17