Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
Created February 4, 2010 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anaisbetts/295127 to your computer and use it in GitHub Desktop.
Save anaisbetts/295127 to your computer and use it in GitHub Desktop.
namespace TheApp
{
public partial class MainWindow : Window
{
IObservable<MouseEventArgs> foo;
public MainWindow()
{
var foo = Observable.FromEvent<MouseEventArgs>(this, "PreviewMouseMove")
.Where(x => { var pos = x.EventArgs.GetPosition(this); return (pos.X < 10 && pos.Y < 10); })
.Subscribe((v) => MessageBox.Show("You're in the corner!"), () => { ; });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment