I am having an issue where the PropertyChanged event from the generated Ria Services entities is not raised for all the properties.
When I look at the generated code (client-side), I can see that my entities are deriving from the Entity object which implements INotifyPropertyChanged. I can also see that some properties, like the Id property, is raising the PropertyChanged event but some are not.
I did not use any T4 templates so the default were used.
So, my question is:
Is there an option/attribute that I can set so that the PropertyChanged event be raised for any properties of the generated client-side entities?
Any help would be appreciated.
EDIT:
Here's an example of a property, in the auto-generated client-side file, which doesn't raise the PropertyChanged event:
[DataMember()]
[Required()]
[StringLength(50)]
public string FirstName
{
get
{
return this._firstName;
}
set
{
if ((this._firstName != value))
{
this.OnFirstNameChanging(value);
this.RaiseDataMemberChanging("FirstName");
this.ValidateProperty("FirstName", value);
this._firstName = value;
this.RaiseDataMemberChanged("FirstName");
this.OnFirstNameChanged();
}
}
}
And this is what was defined in the model server-side:
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.String FirstName
{
get
{
return _FirstName;
}
set
{
OnFirstNameChanging(value);
ReportPropertyChanging("FirstName");
_FirstName = StructuralObject.SetValidValue(value, false);
ReportPropertyChanged("FirstName");
OnFirstNameChanged();
}
}
Here's an example of a property, in the auto-generated client-side file, which does raise the PropertyChanged event:
[DataMember()]
[Editable(false, AllowInitialValue=true)]
[Key()]
[RoundtripOriginal()]
public Guid Id
{
get
{
return this._id;
}
set
{
if ((this._id != value))
{
this.OnIdChanging(value);
this.ValidateProperty("Id", value);
this._id = value;
this.RaisePropertyChanged("Id");
this.OnIdChanged();
}
}
}
And this is what was defined in the model server-side:
[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Guid Id
{
get
{
return _Id;
}
set
{
if (_Id != value)
{
OnIdChanging(value);
ReportPropertyChanging("Id");
_Id = StructuralObject.SetValidValue(value);
ReportPropertyChanged("Id");
OnIdChanged();
}
}
}