开发者

control object subscribing to event from mainwindow

开发者 https://www.devze.com 2023-02-18 04:41 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消