I have a model that looks roughly like this:
private bool IsProduct {get; set;}
private decimal ProductPrice {get; set;}
private decimal TimedRate {get; set;}
public decimal SingularAmount {
get {
if (this.IsProduct) {
return ProductPrice;
}
else {
return TimedRate;
}
}
set {
if (this.IsProduct) {
this.ProductPrice = value;
}
else {
this.TimedRate = value;
}
}
}
I'm binding to this SingularAmount property via RIA Services to Silverlight 3 DataGrid. What I'm finding is that, when I change the property - the respective properties on the model do not get updated. When I step through the code, I can see on the client side, that SingularAmount is set to say 5 for example, the other properties do not get updated.
Seems like when RIA makes the client side version of the classes, this sort of functionality isn't ported over. Any ideas on how to tackle this?
Update
Here is the RIA generated code for that property:
[DataMember()]
public decimal SingularAmount
{
get
{
return this._singularAmount;
}
set
{
if ((this._singularAmount != value))
{
this.ValidateProperty("SingularAmount", value);
this.OnSingularAmountChanging(value);
this.RaiseDataMemberChanging("SingularAmount");
this._singularAmount = value;
this.RaiseDataMemberChanged("SingularAmount");
this.OnSingularAmountChanged();
}
}
}
Obviously, that doesn't look much like the original server side property.