PropertyChanged is not raising from inside realm.Write


#1

I have simple test class

public class Ship : RealmObject
{
 private string Name_ { get; set; }

 public string Name
 {
  get => Name_;
  set => Name_ = value.ToUpper();
 }

 public Ship()
 {
  PropertyChanged+=OnPropertyChanged;
 }

 private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
  switch (e.PropertyName)
  {
   case nameof(TestName_):
    RaisePropertyChanged(nameof(Name));
    break;
  }
 }
}

and now if ship is not managed yet, everything works fine

ship.Name="test";

OnPropertyChanged is called. But if ship is already managed

realm.Write(()=>
{
 ship.Name="test"
});

OnPropertyChanged is never called.

How to fix this code?