public partial class MuestrasEntity : ABusinessEntity { public MuestrasEntity() { this.PropertyChanged += new PropertyChangedEventHandler(MuestrasEntity_ChangeValues); }Second, I added the method to handle the event, that cheks for the correct sender and executes a method with the required code in the business object;
private void MuestrasEntity_ChangeValues(Object sender, PropertyChangedEventArgs e) { MuestrasEntity entity = sender as MuestrasEntity; if (entity != null && entity.BusinessObject != null) { ((MuestrasObj)entity.BusinessObject).MuestrasEntityChangeValues(entity, e.PropertyName); } }At last, I wrote the operations needed in the business objects partial file:
public void MuestrasEntityChangeValues(MuestrasEntity entity, string property) { if (this.State != mmBusinessState.Adding) { if (property == "ValorTotal" || property == "Superficie") { this.SetValorUnitario(entity); } else if (property == "ValorUnitario" || property == "CoefHmgKAvg") { this.SetValorHomogeneo(entity); } else if (property.Contains("CoefHmgK")) { this.SetKAvg(entity); } else if (property == "ValorHomogeneo") { this.SetValoresMedios(); } } }I think of this a a good solution.