protected override void OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e)
 {
     isMouseDown = false;
     wasMouseDown = false;
     last = null;
 }
 public SliderElement()
 {
     slider = new SimpleSlider()
     {
         HorizontalAlignment = HorizontalAlignment.Stretch,
         VerticalAlignment = VerticalAlignment.Center,
         Height = 26,
         Margin = new Thickness(10,0,0,0)
     };
     valueLabel = new TextBlock()
     {
         Foreground = Brushes.White,
         FontSize = 26,
         Text = "0",
         HorizontalAlignment = HorizontalAlignment.Center,
         VerticalAlignment = VerticalAlignment.Center
     };
     Grid grid = new Grid()
     {
         HorizontalAlignment = HorizontalAlignment.Stretch,
         VerticalAlignment = VerticalAlignment.Stretch
     };
     grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
     grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(70, GridUnitType.Pixel) });
     Grid.SetColumn(valueLabel, 1);
     grid.Children.Add(slider);
     grid.Children.Add(valueLabel);
     Child = grid;
     LogicalChild = slider;
     slider.ValueChanged += slider_ValueChanged;
 }
 protected override void OnMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs e)
 {
     if (IsEnabled)
     {
         isMouseDown = true;
         last = this;
         OnMouseMove(e);
         mouseDown = DateTime.Now;	// Do this after OnMouseMove so that one gets executed once before the 60ms break;
     }
 }