I've been finding various methods of dealing with double click and then the authors slap on some if code for handling single clicks. Is there a standard now in Silverlight 3 that everyone is using to handle both a single and a double click on listboxes?
If you use the Reactive Extensions (Rx) library the code to support double click is much simpler:
Observable.FromEvent<MouseButtonEventArgs>(myControl, "MouseLeftButtonDown").TimeInterval().Subscribe(evt =>
{
if (evt.Interval.TotalMilliseconds <= 300)
{
// Do something on double click
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With