WeakEventManager for Action <>

时间:2018-12-12 16:35:28

标签: c# weak-references weakeventmanager

我知道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 
}

您对此案有何建议? 预先感谢!

0 个答案:

没有答案