As a proof of concept, I want to write “Done” in a text box after a check box has been checked and a key has been pressed in a text box (in either order). I would expect this code to handle this, but it writes Done as soon as either event happens. Thanks for your help.
var seq = Observable.FromEvent<EventArgs>(this.checkBox, "CheckedChanged")
.Merge(Observable.FromEvent<KeyPressEventArgs>(this.textBox, "KeyPress"));
seq.Subscribe((unused) => this.resultTextBox.Text = "Done");
You can use Observable.When like so (I’ve added an additional CheckBox for this example):
Also, if you can join other plans together, for example if things can be “done” when either one set of events fire, or also when another set of events fire: