partial class DaveKehring : IProgrammer { }  RSS 2.0
# Wednesday, September 24, 2008

Here's a nice way to bind to mouse events to a RoutedCommand. My RoutedCommand is defined in a ViewModel (in the Model-View-ViewModel pattern):

<Image Name="Image" Grid.Row="0"
          
Source="{Binding DataModel.Thumbnail, Converter={StaticResource
                       
ImageConverter}}">
   
<Image.InputBindings>
       
<MouseBinding MouseAction="LeftDoubleClick"
                           
Command="vm:ThumbnailViewModel.PreviewCommand"/>
   
</Image.InputBindings>
</Image>

Wednesday, September 24, 2008 10:39:48 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
M-V-VM | WPF
Comments are closed.
Navigation
Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
Dave Kehring
Sign In
Statistics
Total Posts: 11
This Year: 0
This Month: 0
This Week: 0
Comments: 2
Themes
Pick a theme:
All Content © 2012, Dave Kehring
DasBlog theme 'Business' created by Christoph De Baene (delarou)