Are there design guidelines on how to name methods that trigger an event in .NET? In different examples I’ve seen all of:
OnPropertyChanged()
FirePropertyChanged()
TriggerPropertyChanged()
RaisePropertyChanged()
Of course this is not hugely important, but I’d like to do it the “right” way and not confuse others with unusual naming conventions. =)
You should use
OnPropertyChangedaccording to MSDN, CodeProject and the book Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries (2nd Edition).EDIT:
The quote from CodeProject only refers to the naming of the event, e.g. if your event signalizes that a alarm has happened it should be named
AlarmRaised.