我知道WeakEventManager适用于委托:
public delegate void EventHandler<TEventArgs>(object sender, TEventArgs e);
但是,我想使用WeakEventManager进行以下操作:
public class SourceEvent
{
public event Action<int, int> MyEvent;
}
public class Listener
{
private SourceEvent source;
// Add listener
source.MyEvent += listener_handler;
// I want to replace operator "+" by AddHandler of WeakEventManger
}
您对此案有何建议? 预先感谢!