- Edited
For some reason, I still cannot handle events properly in .NET. I always feel there's a missing link between my brain and the CLR's event model.
Anyway, I have a few questions...
1. Is it okey to handle the same event in two different places? (ex: notice how I'm handling the storyboard's Completed event twice.)
2. Is there a way to extend the event args and still manage to handle the event inside the custom control? What I mean is, in the case mentioned in the link above, can I inherit from MouseEventArgs and add an Action property to it which will be filled outside the control but executed inside? (notice how I'm passing an Action parameter to the OnMouseEnter method...).
3. What's the best way of exposing events (Click event for example) on a control? Do I need to use an EventAggregator in this case (Publish - Subscribe pattern)?
Anyway, I have a few questions...
1. Is it okey to handle the same event in two different places? (ex: notice how I'm handling the storyboard's Completed event twice.)
2. Is there a way to extend the event args and still manage to handle the event inside the custom control? What I mean is, in the case mentioned in the link above, can I inherit from MouseEventArgs and add an Action property to it which will be filled outside the control but executed inside? (notice how I'm passing an Action parameter to the OnMouseEnter method...).
3. What's the best way of exposing events (Click event for example) on a control? Do I need to use an EventAggregator in this case (Publish - Subscribe pattern)?