C# Dynamic Event Subscription

前端 未结 9 1912
無奈伤痛
無奈伤痛 2020-12-01 03:09

How would you dynamically subscribe to a C# event so that given a Object instance and a String name containing the name of the event, you subscribe to that event and do some

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 03:39

    What you want can be achieved using dependency injection. For example Microsoft Composite UI app block does exactly what you described

提交回复
热议问题