Home

Hooking up System.Reactive 4.1.2 to new LINQPad.Controls events throws exception on Subscribe

edited November 2018
Hi,

I'm attempting to hook up the TextBox.TextInput event using System.Reactive, but keep getting the Exception: ArgumentException: Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type. Is it simply too late at night? What am I missing?

Namespace imports:
LINQPad.Controls
System.Reactive
System.Reactive.Linq

void Main()
{
var textBox = new TextBox();
var observable = Observable.FromEvent(h => textBox.TextInput += h, h => textBox.TextInput -= h);
observable.Subscribe(o => o.Dump());
textBox.Dump();
}

Comments

Sign In or Register to comment.