Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以创建一个自动调用或执行的扩展?
.
我有一个System.Windows.Control应该在初始化后执行一些逻辑而不调用这个扩展手册Control.myExtension();
System.Windows.Control
Control.myExtension();
将我的评论转换为答案:
类级事件处理程序
但是,这取决于您想要什么,这可能是一个好主意,也可能不是一个好主意。