I sort of have a solution that might solve the video scrubber issue. It involves creating your own derived slider control and adding event handlers for dragstarted and dragcompleted. These events already exist on the Thumb part of the slider, but not on the slider itself. So if we find the Thumb and just pass on the events we can detect when dragging starts and when it ends. Here's the code:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;
using System.ComponentModel;
namespace CustomControls
{
public class CustomSlider : Slider
{
/// <summary>
/// Thrown when the thumb has been clicked, and dragging is initiated
/// </summary>
public event EventHandler<EventArgs> ThumbDragStarted;
/// <summary>
/// Thrown when the thumb has been released
/// </summary>
public event EventHandler<EventArgs> ThumbDragCompleted;
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
//Set up drag event handlers
Thumb thumb = this.GetTemplateChild("HorizontalThumb") as Thumb;
if (thumb != null)
{
thumb.DragStarted += new DragStartedEventHandler(thumb_DragStarted);
thumb.DragCompleted += new DragCompletedEventHandler(thumb_DragCompleted);
}
}
void thumb_DragCompleted(object sender, DragCompletedEventArgs e)
{
OnThumbDragCompleted(this, new EventArgs());
}
void thumb_DragStarted(object sender, DragStartedEventArgs e)
{
OnThumbDragStarted(this, new EventArgs());
}
protected virtual void OnThumbDragStarted(object sender, EventArgs e)
{
if (ThumbDragStarted != null)
ThumbDragStarted(sender, e);
}
protected virtual void OnThumbDragCompleted(object sender, EventArgs e)
{
if (ThumbDragCompleted != null)
ThumbDragCompleted(sender, e);
}
}
}