Created
February 11, 2014 06:57
-
-
Save jen20/8930380 to your computer and use it in GitHub Desktop.
Binding double clicking a data grid to a ReactiveCommand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observable.FromEventPattern<MouseButtonEventHandler, MouseButtonEventArgs> | |
(h => JobsGrid.MouseDoubleClick += h, h => JobsGrid.MouseDoubleClick -= h) | |
.InvokeCommand(this, v => v.ViewModel.GoToJob); |
I could, except it doesn't appear to expose MouseDoubleClick
- that was the first thing I tried :-)
JobsGrid
is a System.Windows.Controls.DataGrid
by the way.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I bet you can do even better if you use ReactiveUI.Events: