Hi!

I am working on refactoring an application that is written as a Model View Presenter (winforms).

I am stuck on a scenario where the view fires events to the presenter when certain properties are changed. For example, if the user is selecting data in a combobox, an "CountryValueSelectedChanged" event is fired as an Action<int id> where id is the value selected. Same for textboxes where the keyup-event fires an OnFirstNameChanged event which is an Action<string name>.

Would it be possible to write a single OnPropertyChanged<T> method, since both the view and the presenter are aware of T (which is the domain entity) Then I just need a way to inform this generic event two things

1) The new value
2) Which property that was changed.

How do I do this in a clever way? I have on the presenter a property of type T which is called "selectedEntity; In the event handler for OnPropertyChanged<T> I want to be able to do:

"selectedEntity.X = newValue.X;"

How can I define X?

/Henrik