Answered by:
Double click support coming????

Question
-
Trying to implement double click within a datagrid. No can do. There used to be an easy roll-your-own solution when you had access to buttondown/up events, but now those are gone with 2.0.
Is support for dblclick in controls coming in 3.0? Really bizarre that it wasn't there right from the get go, especially for list-type controls. Right click popup-context menus would also be a huge help. (RIAs, right?)
Thank you.
Wednesday, June 10, 2009 11:36 AM
Answers
-
There isn't support for double click in SL 3, but SL 3 gives you the ability to listen to handled events via the AddHandler method. Using this, you could potentially roll your own solution by listening to all of the MouseLeftButtonDown events
Wednesday, June 10, 2009 7:56 PM
All replies
-
There isn't support for double click in SL 3, but SL 3 gives you the ability to listen to handled events via the AddHandler method. Using this, you could potentially roll your own solution by listening to all of the MouseLeftButtonDown events
Wednesday, June 10, 2009 7:56 PM -
In SL3 I not found the way to do that but you can implement double click by you self like
1 // In App.cs file 2 public static DateTime LastClick; 3 public static double DoubleClickTime = 350; 4 5 // put event on click 6 private void dgSaleItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) 7 { 8 var ts = DateTime.Now - App.LastClick; 9 if (ts.TotalMilliseconds < App.DoubleClickTime) 10 { 11 // double click event happen 12 } 13 14 App.LastClick = DateTime.Now; 15 }
I hear that the reason SL3 do not support double click because It want to support MAC
Thursday, June 11, 2009 12:44 AM -
Thursday, June 11, 2009 12:49 AM
-
mousebutton events no longer "bubble up" for user controls starting with sl 2.0.
" I hear that the reason SL3 do not support double click because It want to support MAC "
??? Mac's don't support double click?
Thursday, June 11, 2009 2:34 PM -
Won't work. Button events unavailable for user controls starting w/ 2.0
Thursday, June 11, 2009 2:37 PM -
in silverlight 3, you could use addhandler to handle FrameworkElement.MouseLeftButtonDown event, and implement your custom double click event
sample for AddHandler
http://silverlight.net/forums/t/96841.aspx
and here is a thread for right click capture
http://silverlight.net/forums/t/95832.aspx
Monday, June 15, 2009 11:25 PM