I want to raise events from a user control and no matter how much I read up on routed events in WPF I just can't seem to get my head totally around them.
I've just about figured out how to raise an event from a user control and handle that event in the parent window but in one particular scenario the user control is actually contained within another user control which is then contained within a parent window. Is it a case of raising the event in the user control, catching it in the parent user control and raising it again to be caught in the parent window?
Also, I've been using code similar to the below; what does this do? The reason I ask is that my events still seem to fire if I comment this out so I'm not sure what the purpose of this is
Public Custom Event PaymentDetailsChanged As PaymentDetailsChangedHandler
AddHandler(ByVal value As PaymentDetailsChangedHandler)
RemoveHandler(ByVal value As PaymentDetailsChangedHandler)
RaiseEvent(ByVal sender As Object, ByVal e As PaymentDetailsChangedArgs)
Any suggestions of what I should actually be doing would be great, code examples preferably in VB.Net