if ((this._PetName != value))
{
this.OnPetNameChanging(value);
this.SendPropertyChanging();
this._PetName = value;
this.SendPropertyChanged("PetName");
this.OnPetNameChanged();
}
}
}
Notice that the set scope invokes the OnPetNameChanging() and OnPetNameChanged() methods
on the entity class type to actually fire the events themselves. However, these members are defined
as
partial methods, which you may recall from Chapter 13 perform a type of lightweight event han-
dling, allowing interested callers to provide an implementation if they so choose (if not, they are
removed from the type definition at compile time):
partial void OnPetNameChanging(string value);
partial void OnPetNameChanged();
Do'stlaringiz bilan baham: