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}" />