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

edited November 19
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

  • I've figured it out. For this to work I need to use Observable.FromEventPattern.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!