Re: Cannot unregister routed event handler (v2.0.1f1, C++)
Posted: 02 Sep 2017, 15:10
Oh! This is great! Thanks for sharing this workaround, it will be helpful for more people.
Welcome to our official discussion site. You’ll find topics on features, bugs, development, and general support here
https://www.noesisengine.com/forums/
subscriber.on_next(param);
subscriber.add([_ev, wrapper]() {
// In the event of unsubscribe, remove the callback from the NoesisGUI event
auto ev = const_cast<C<Delegate<Ret(Args...)>> &>(_ev);
ev -= MakeDelegate(wrapper.get(), &FunctorToDelegate<Ret, Args...>::Invoke);
});