control object subscribing to event from mainwindow
My application is a UserControl which has a grid whose content is loaded dynamically. Essentially, I maintain a list of c开发者_C百科hild objects and replace the grid child whenever needed. I now need the child object to subscribe to an event that is raised by the UserControl. If it was the other way round I would have just done child.property +=.... How do I get this to happen?
If the child object already implements the features that you need to trigger, you can have the UserControl subscribe to the event on its own, then call the child functionality from the handler.
精彩评论