Is it possible to change sender's property in event?
I have my own control in wpf with 10 Image controls. I set on all of them mouse enter and mouse leave events. All those events do the same(change size and Z index) but for specific Image.
With changing sender's property in event I will have only 2 event's methods, not 20. When I tried to change sender's property I saw it was readonly.
Is it possible to do ?
Point all your controls at the same handlers. You can do this at design time or through code.
In the handler cast sender to the type of control.
Now when you change it's properties, you are changing the properties of the control that raised the event
PS don't forget to check to see if the cast is valid, before you try to access it's members.