I made this behaviour just to enable double click events in Silverlight. It’s easy to work with this. Just remember to handle the click and double click event of the behaviour and avoid handling the control mouseButtonUp event, as it will make that the behaviour never handles its events.

Install Microsoft Silverlight

Download Demo

Note that this example takes the button as pressed when the user releases de mouse button. In the code below I have implemented a behaviour version that can work as Release or Press click mode.

Imports System
Imports System.IO
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Input
Imports System.Windows.Interactivity
Imports System.Windows.Automation.Peers
Imports System.Windows.Threading

Public Class DoubleClickBehaviour
    Inherits Behavior(Of UIElement)

    Private _peer As AutomationPeer
    Private _waiting As Boolean
    Private _waitingSince As DateTime
    Public Event MouseDoubleclick As MouseButtonEventHandler
    Public Event MouseClick As MouseButtonEventHandler
    Private _interval As Integer = 500
    Dim timerUp As DispatcherTimer
    Dim timerDown As DispatcherTimer
    Dim eventargs As MouseButtonEventArgs
    Dim _clickStartedHere As Boolean
    Dim _clickMode As ClickModeEnum = ClickModeEnum.Release

    Public Enum ClickModeEnum
        Release = 1
        Press = 2
    End Enum

    Public Property ClickMode() As ClickModeEnum
            Return _clickMode
        End Get
        Set(ByVal value As ClickModeEnum)
            _clickMode = value
        End Set
    End Property

    Public Property Interval() As Integer
            Return _interval
        End Get
        Set(ByVal value As Integer)
            _interval = value
            timerUp.Interval = New TimeSpan(0, 0, 0, 0, value)
            timerDown.Interval = New TimeSpan(0, 0, 0, 0, value)
        End Set
    End Property

    Private Property Peer() As AutomationPeer
            Return _peer
        End Get
        Set(ByVal value As AutomationPeer)
            _peer = value
        End Set
    End Property

    Public Sub New()
        timerUp = New DispatcherTimer
        timerDown = New DispatcherTimer
        Interval = _interval
        AddHandler timerUp.Tick, AddressOf Timerup_tick
        AddHandler timerDown.Tick, AddressOf Timerdown_tick
    End Sub

    Protected Overrides Sub OnAttached()
        Peer = If(FrameworkElementAutomationPeer.FromElement(AssociatedObject), FrameworkElementAutomationPeer.CreatePeerForElement(AssociatedObject))
        AddHandler AssociatedObject.MouseLeftButtonUp, AddressOf AssociatedObject_MouseLeftButtonUp
        AddHandler AssociatedObject.MouseLeftButtonDown, AddressOf AssociatedObject_MouseLeftButtonDown
    End Sub

    Protected Overrides Sub OnDetaching()
        Dim mouseUp As MouseButtonEventHandler = AddressOf AssociatedObject_MouseLeftButtonUp
        Dim mouseDown As MouseButtonEventHandler = AddressOf AssociatedObject_MouseLeftButtonDown
        RemoveHandler AssociatedObject.MouseLeftButtonUp, mouseUp
        RemoveHandler AssociatedObject.MouseLeftButtonDown, mouseDown
    End Sub

    Private Sub AssociatedObject_MouseLeftButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
        If ClickMode = ClickModeEnum.Release Then
            'release functionality
            _clickStartedHere = True
            'press functionality
        End If
    End Sub

    Private Sub AssociatedObject_MouseLeftButtonUp(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
        If Not _clickStartedHere Then Exit Sub
    End Sub

    Private Sub ClickControl(ByVal e As MouseButtonEventArgs)
        If _waiting Then
            If DateTime.Now.Subtract(_waitingSince).TotalMilliseconds < Interval Then
                _waiting = False
                RaiseEvent MouseDoubleclick(AssociatedObject, e)
            End If
            eventargs = e
            _waiting = True
            _waitingSince = DateTime.Now
        End If
    End Sub

    Private Sub Timerup_tick(ByVal sender As Object, ByVal e As EventArgs)
        If _waiting Then
            RaiseEvent MouseClick(AssociatedObject, eventargs)
        End If
        _waiting = False
    End Sub

    Private Sub Timerdown_tick(ByVal sender As Object, ByVal e As EventArgs)
        _clickStartedHere = False
    End Sub

End Class