1
// Copyright Ā© Microsoft Corporation.
2
// This source is subject to the Microsoft Source License for Silverlight Controls (March 2008 Release).
3
// Please see http://go.microsoft.com/fwlink/?LinkID=111693 for details.
4
// All other rights reserved.
6
using System.Diagnostics;
7
using System.Windows.Input;
8
using System.Windows.Markup;
9
using System.Windows.Media.Animation;
10
using System.Windows.Media;
11
using System.Windows.Controls;
12
//using System.Windows.Controls.Primitives;
14
namespace System.Windows.Controls.Primitives
17
/// ScrollBars are the UI widgets that both let a user drive scrolling from the UI
18
/// and indicate status of scrolled content.
19
/// These are used inside the ScrollViewer.
20
/// Their visibility is determined by the scroller visibility properties on ScrollViewer.
22
[TemplatePart(Name = ScrollBar.ElementRootName, Type = typeof(FrameworkElement))]
23
[TemplatePart(Name = ScrollBar.ElementHorizontalTemplateName, Type = typeof(FrameworkElement))]
24
[TemplatePart(Name = ScrollBar.ElementHorizontalLargeIncreaseName, Type = typeof(RepeatButton))]
25
[TemplatePart(Name = ScrollBar.ElementHorizontalLargeDecreaseName, Type = typeof(RepeatButton))]
26
[TemplatePart(Name = ScrollBar.ElementHorizontalThumbName, Type = typeof(Thumb))]
27
[TemplatePart(Name = ScrollBar.ElementVerticalTemplateName, Type = typeof(FrameworkElement))]
28
[TemplatePart(Name = ScrollBar.ElementVerticalLargeIncreaseName, Type = typeof(RepeatButton))]
29
[TemplatePart(Name = ScrollBar.ElementVerticalLargeDecreaseName, Type = typeof(RepeatButton))]
30
[TemplatePart(Name = ScrollBar.ElementVerticalThumbName, Type = typeof(Thumb))]
31
[TemplatePart(Name = ScrollBar.StateNormalName, Type = typeof(Storyboard))]
32
[TemplatePart(Name = ScrollBar.StateMouseOverName, Type = typeof(Storyboard))]
33
[TemplatePart(Name = ScrollBar.StateDisabledName, Type = typeof(Storyboard))]
34
public sealed class ScrollBar : RangeBase
38
/// Constructor to setup the ScrollBar class
48
Orientation = Orientation.Horizontal;
49
MouseEnter += delegate(object sender, MouseEventArgs e) { OnMouseEnter(e); };
50
MouseLeave += delegate(object sender, MouseEventArgs e) { OnMouseLeave(e); };
51
MouseLeftButtonDown += delegate(object sender, MouseButtonEventArgs e) { OnMouseLeftButtonDown(e); };
52
MouseLeftButtonUp += delegate(object sender, MouseButtonEventArgs e) { OnMouseLeftButtonUp(e); };
53
SizeChanged += delegate { UpdateTrackLayout(GetTrackLength()); };
57
/// Apply a template to the ScrollBar.
59
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
60
public override void OnApplyTemplate()
62
base.OnApplyTemplate();
65
ElementRoot = GetTemplateChild(ElementRootName) as FrameworkElement;
66
ElementHorizontalLargeIncrease = GetTemplateChild(ElementHorizontalLargeIncreaseName) as RepeatButton;
67
ElementHorizontalLargeDecrease = GetTemplateChild(ElementHorizontalLargeDecreaseName) as RepeatButton;
68
ElementHorizontalSmallIncrease = GetTemplateChild(ElementHorizontalSmallIncreaseName) as RepeatButton;
69
ElementHorizontalSmallDecrease = GetTemplateChild(ElementHorizontalSmallDecreaseName) as RepeatButton;
70
ElementHorizontalThumb = GetTemplateChild(ElementHorizontalThumbName) as Thumb;
71
ElementVerticalTemplate = GetTemplateChild(ElementVerticalTemplateName) as FrameworkElement;
72
ElementVerticalLargeIncrease = GetTemplateChild(ElementVerticalLargeIncreaseName) as RepeatButton;
73
ElementVerticalLargeDecrease = GetTemplateChild(ElementVerticalLargeDecreaseName) as RepeatButton;
74
ElementVerticalSmallIncrease = GetTemplateChild(ElementVerticalSmallIncreaseName) as RepeatButton;
75
ElementVerticalSmallDecrease = GetTemplateChild(ElementVerticalSmallDecreaseName) as RepeatButton;
76
ElementVerticalThumb = GetTemplateChild(ElementVerticalThumbName) as Thumb;
79
if (ElementRoot != null)
81
StateNormal = ElementRoot.Resources[StateNormalName] as Storyboard;
82
StateMouseOver = ElementRoot.Resources[StateMouseOverName] as Storyboard;
83
StateDisabled = ElementRoot.Resources[StateDisabledName] as Storyboard;
86
if (ElementHorizontalThumb != null)
88
ElementHorizontalThumb.DragStarted += new DragStartedEventHandler(OnThumbDragStarted);
89
ElementHorizontalThumb.DragDelta += new DragDeltaEventHandler(OnThumbDragDelta);
90
ElementHorizontalThumb.DragCompleted += new DragCompletedEventHandler(OnThumbDragCompleted);
92
if (ElementHorizontalLargeDecrease != null)
94
ElementHorizontalLargeDecrease.Click += delegate
97
RaiseScrollEvent(ScrollEventType.LargeDecrement);
100
if (ElementHorizontalLargeIncrease != null)
102
ElementHorizontalLargeIncrease.Click += delegate
104
Value += LargeChange;
105
RaiseScrollEvent(ScrollEventType.LargeIncrement);
108
if (ElementHorizontalSmallDecrease != null)
110
ElementHorizontalSmallDecrease.Click += delegate
112
Value -= SmallChange;
113
RaiseScrollEvent(ScrollEventType.SmallDecrement);
116
if (ElementHorizontalSmallIncrease != null)
118
ElementHorizontalSmallIncrease.Click += delegate
120
Value += SmallChange;
121
RaiseScrollEvent(ScrollEventType.SmallIncrement);
124
if (ElementVerticalThumb != null)
126
ElementVerticalThumb.DragStarted += new DragStartedEventHandler(OnThumbDragStarted);
127
ElementVerticalThumb.DragDelta += new DragDeltaEventHandler(OnThumbDragDelta);
128
ElementVerticalThumb.DragCompleted += new DragCompletedEventHandler(OnThumbDragCompleted);
130
if (ElementVerticalLargeDecrease != null)
132
ElementVerticalLargeDecrease.Click += delegate
134
Value -= LargeChange;
135
RaiseScrollEvent(ScrollEventType.LargeDecrement);
138
if (ElementVerticalLargeIncrease != null)
140
ElementVerticalLargeIncrease.Click += delegate
142
Value += LargeChange;
143
RaiseScrollEvent(ScrollEventType.LargeIncrement);
146
if (ElementVerticalSmallDecrease != null)
148
ElementVerticalSmallDecrease.Click += delegate
150
Value -= SmallChange;
151
RaiseScrollEvent(ScrollEventType.SmallDecrement);
154
if (ElementVerticalSmallIncrease != null)
156
ElementVerticalSmallIncrease.Click += delegate
158
Value += SmallChange;
159
RaiseScrollEvent(ScrollEventType.SmallIncrement);
162
// Updating states for parts where properties might have been updated through
163
// XAML before the template was loaded.
164
OnIsEnabledChanged(IsEnabled);
165
OnOrientationChanged();
168
#endregion Constructor
172
/// Gets whether the ScrollBar has an orientation of vertical or horizontal.
174
public Orientation Orientation
176
get { return (Orientation)GetValue(OrientationProperty); }
177
set { SetValue(OrientationProperty, value); }
181
/// Identifies the Orientation dependency property.
183
public static readonly DependencyProperty OrientationProperty =
184
DependencyProperty.Register(
188
new PropertyMetadata(OnOrientationPropertyChanged));
191
/// OrientationProperty property changed handler.
193
/// <param name="d">ScrollBar that changed Orientation.</param>
194
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
195
private static void OnOrientationPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
197
ScrollBar s = d as ScrollBar;
198
Debug.Assert(s != null);
200
s.OnOrientationChanged();
203
#endregion Orientation
207
/// ViewportSize is the amount of the scrolled extent currently visible.
208
/// For most scrolled content, this value will be bound to one of ScrollViewer's
209
/// ViewportSize properties. This property is in logical scrolling units.
211
public double ViewportSize
213
get { return (double)GetValue(ViewportSizeProperty); }
214
set { SetValue(ViewportSizeProperty, value); }
218
/// Identifies the ViewportSize dependency property.
220
public static readonly DependencyProperty ViewportSizeProperty =
221
DependencyProperty.Register(
225
new PropertyMetadata(OnViewportSizeChanged));
227
private static void OnViewportSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
229
ScrollBar s = d as ScrollBar;
230
Debug.Assert(s != null);
232
s.UpdateTrackLayout(s.GetTrackLength());
235
#endregion ViewportSize
239
/// Gets or sets a value that indicates whether this element is enabled
240
/// in the user interface (UI).
242
public bool IsEnabled
244
get { return (bool)GetValue(IsEnabledProperty); }
245
set { SetValue(IsEnabledProperty, value); }
249
/// Identifies the IsEnabled dependency property.
251
public static readonly DependencyProperty IsEnabledProperty =
252
DependencyProperty.Register(
256
new PropertyMetadata(OnIsEnabledPropertyChanged));
259
/// IsEnabledProperty property changed handler.
261
/// <param name="d">ScrollBar that changed IsEnabled.</param>
262
/// <param name="e">DependencyPropertyChangedEventArgs.</param>
263
private static void OnIsEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
265
ScrollBar s = d as ScrollBar;
266
Debug.Assert(s != null);
268
bool value = (bool)e.NewValue;
269
s.OnIsEnabledChanged(value);
273
/// Called when the IsEnabled property changes.
275
/// <param name="isEnabled">New value of the IsEnabled property.</param>
276
private void OnIsEnabledChanged(bool isEnabled)
278
if (ElementHorizontalSmallDecrease != null)
280
ElementHorizontalSmallDecrease.IsEnabled = isEnabled;
282
if (ElementHorizontalLargeDecrease != null)
284
ElementHorizontalLargeDecrease.IsEnabled = isEnabled;
286
if (ElementHorizontalThumb != null)
288
ElementHorizontalThumb.IsEnabled = isEnabled;
290
if (ElementHorizontalLargeIncrease != null)
292
ElementHorizontalLargeIncrease.IsEnabled = isEnabled;
294
if (ElementHorizontalSmallIncrease != null)
296
ElementHorizontalSmallIncrease.IsEnabled = isEnabled;
298
if (ElementVerticalSmallDecrease != null)
300
ElementVerticalSmallDecrease.IsEnabled = isEnabled;
302
if (ElementVerticalLargeDecrease != null)
304
ElementVerticalLargeDecrease.IsEnabled = isEnabled;
306
if (ElementVerticalThumb != null)
308
ElementVerticalThumb.IsEnabled = isEnabled;
310
if (ElementVerticalLargeIncrease != null)
312
ElementVerticalLargeIncrease.IsEnabled = isEnabled;
314
if (ElementVerticalSmallIncrease != null)
316
ElementVerticalSmallIncrease.IsEnabled = isEnabled;
324
#region OnValueChanged
327
/// Called when the Value property changes.
329
/// <param name="oldValue">Old value of the Value property.</param>
330
/// <param name="newValue">New value of the Value property.</param>
331
protected override void OnValueChanged(double oldValue, double newValue)
333
double trackLength = GetTrackLength();
335
base.OnValueChanged(oldValue, newValue);
337
UpdateTrackLayout(trackLength);
341
/// Called when the Maximum property changes
343
/// <param name="oldMaximum">Old value of the Maximum property.</param>
344
/// <param name="newMaximum">New value of the Maximum property.</param>
345
protected override void OnMaximumChanged(double oldMaximum, double newMaximum)
347
double trackLength = GetTrackLength();
349
base.OnMaximumChanged(oldMaximum, newMaximum);
350
UpdateTrackLayout(trackLength);
354
/// Called when the Minimum property changes
356
/// <param name="oldMinimum">Old value of the Minimum property.</param>
357
/// <param name="newMinimum">New value of the Minimum property.</param>
358
protected override void OnMinimumChanged(double oldMinimum, double newMinimum)
360
double trackLength = GetTrackLength();
362
base.OnMinimumChanged(oldMinimum, newMinimum);
363
UpdateTrackLayout(trackLength);
370
/// Responds to the MouseEnter event.
372
/// <param name="e">The event data for the MouseEnter event.</param>
373
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "e", Justification = "Compat with WPF.")]
374
private void OnMouseEnter(MouseEventArgs e)
378
if ((Orientation == Orientation.Horizontal && ElementHorizontalThumb != null && !ElementHorizontalThumb.IsDragging) ||
379
(Orientation == Orientation.Vertical && ElementVerticalThumb != null && !ElementVerticalThumb.IsDragging))
386
/// Responds to the MouseLeave event.
388
/// <param name="e">The event data for the MouseLeave event.</param>
389
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "e", Justification = "Compat with WPF.")]
390
private void OnMouseLeave(MouseEventArgs e)
394
if ((Orientation == Orientation.Horizontal && ElementHorizontalThumb != null && !ElementHorizontalThumb.IsDragging) ||
395
(Orientation == Orientation.Vertical && ElementVerticalThumb != null && !ElementVerticalThumb.IsDragging))
402
/// Responds to the MouseLeftButtonDown event.
404
/// <param name="e">The event data for the MouseLeftButtonDown event.</param>
405
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "e", Justification = "Compat with WPF.")]
406
private void OnMouseLeftButtonDown(MouseButtonEventArgs e)
413
/// Responds to the MouseLeftButtonUp event.
415
/// <param name="e">The event data for the MouseLeftButtonUp event.</param>
416
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "e", Justification = "Compat with WPF.")]
417
private void OnMouseLeftButtonUp(MouseButtonEventArgs e)
420
ReleaseMouseCapture();
423
#endregion MouseEvents
427
/// Event that gets fired when the ScrollBar's value is changed
428
/// through the Thumb, RepeatButtons, or Keyboard interaction
430
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1009:DeclareEventHandlersCorrectly", Justification = "Derives from RoutedEventArgs instead of EventArgs")]
431
internal event EventHandler<ScrollEventArgs> Scroll;
434
/// This raises the Scroll event, passing in the scrollEventType
435
/// as a parameter to let the handler know what triggered this event.
437
/// <param name="scrollEventType">ScrollEventType</param>
438
internal void RaiseScrollEvent(ScrollEventType scrollEventType)
440
ScrollEventArgs newEvent = new ScrollEventArgs(scrollEventType, Value);
441
newEvent.OriginalSource = this;
445
Scroll(this, newEvent);
449
#endregion ScrollEvent
453
/// Update the current visual state of the ScrollBar.
455
internal void UpdateVisualState()
459
ChangeVisualState(StateDisabled ?? StateNormal);
465
ChangeVisualState(StateMouseOver ?? StateNormal);
469
ChangeVisualState(StateNormal);
475
/// Change the visual state of the ScrollBar.
477
/// <param name="state">Next visual state of the ScrollBar.</param>
479
/// This method should not be called by controls to force a change to
480
/// the current visual state. UpdateVisualState is preferred because
481
/// it properly handles suspension of state changes.
483
internal void ChangeVisualState(Storyboard state)
485
Storyboard previousState = _currentState;
486
if (state == previousState)
493
if (previousState != null)
495
previousState.Stop();
497
_currentState = state;
501
#endregion Change State
505
private void OnThumbDragCompleted(Object sender, DragCompletedEventArgs e)
507
RaiseScrollEvent(ScrollEventType.EndScroll);
510
private void OnThumbDragStarted(Object sender, DragStartedEventArgs e)
512
this._dragValue = this.Value;
516
/// Whenever the thumb gets dragged, we handle the event through
517
/// this function to update the current value depending upon the
518
/// thumb drag delta.
520
/// <param name="e">DragEventArgs</param>
521
private void OnThumbDragDelta(Object sender, DragDeltaEventArgs e)
525
if (Orientation == Orientation.Horizontal && ElementHorizontalThumb != null)
527
offset = e.HorizontalChange / (GetTrackLength() - ElementHorizontalThumb.ActualWidth) * (Maximum - Minimum);
529
else if (Orientation == Orientation.Vertical && ElementVerticalThumb != null)
531
offset = e.VerticalChange / (GetTrackLength() - ElementVerticalThumb.ActualHeight) * (Maximum - Minimum);
534
if (!double.IsNaN(offset) && !double.IsInfinity(offset))
536
_dragValue += offset;
538
double newValue = Math.Min(Maximum, Math.Max(Minimum, _dragValue));
540
if (newValue != Value)
543
RaiseScrollEvent(ScrollEventType.ThumbTrack);
550
#region UpdateTrackLayout
553
/// This code will run whenever Orientation changes, to change the template
554
/// being used to display this control.
556
private void OnOrientationChanged()
558
double trackLength = GetTrackLength();
560
if (ElementHorizontalTemplate != null)
562
ElementHorizontalTemplate.Visibility = (Orientation == Orientation.Horizontal ? Visibility.Visible : Visibility.Collapsed);
564
if (ElementVerticalTemplate != null)
566
ElementVerticalTemplate.Visibility = (Orientation == Orientation.Horizontal ? Visibility.Collapsed : Visibility.Visible);
568
UpdateTrackLayout(trackLength);
572
/// This method will take the current min, max, and value to
573
/// calculate and layout the current control measurements.
575
private void UpdateTrackLayout(double trackLength)
577
double maximum = Maximum;
578
double minimum = Minimum;
579
double value = Value;
580
double multiplier = (value - minimum) / (maximum - minimum);
582
double thumbSize = UpdateThumbSize(trackLength);
584
if (Orientation == Orientation.Horizontal && ElementHorizontalLargeDecrease != null && ElementHorizontalThumb != null)
586
ElementHorizontalLargeDecrease.Width = multiplier * (trackLength - thumbSize);
588
else if (Orientation == Orientation.Vertical && ElementVerticalLargeDecrease != null && ElementVerticalThumb != null)
590
ElementVerticalLargeDecrease.Height = multiplier * (trackLength - thumbSize);
595
/// Based on the size of the Large Increase/Decrease RepeatButtons
596
/// and on the Thumb, we will calculate the size of the track area
599
/// <returns>The length of the track</returns>
600
internal double GetTrackLength()
602
double length = Double.NaN;
604
if (Orientation == Orientation.Horizontal)
606
length = this.ActualWidth;
608
if (ElementHorizontalSmallDecrease != null)
610
length -= ElementHorizontalSmallDecrease.ActualWidth;
612
if (ElementHorizontalSmallIncrease != null)
614
length -= ElementHorizontalSmallIncrease.ActualWidth;
619
length = this.ActualHeight;
621
if (ElementVerticalSmallDecrease != null)
623
length -= ElementVerticalSmallDecrease.ActualHeight;
625
if (ElementVerticalSmallIncrease != null)
627
length -= ElementVerticalSmallIncrease.ActualHeight;
635
/// Based on the ViewportSize, the Track's length, and the
636
/// Minimum and Maximum values, we will calculate the length
639
/// <returns>Double value representing display unit length</returns>
640
private double ConvertViewportSizeToDisplayUnits(double trackLength)
642
double viewRangeValue = Maximum - Minimum;
644
return trackLength * ViewportSize / (ViewportSize + viewRangeValue);
648
/// This will resize the Thumb, based on calculations with the ViewportSize,
649
/// the Track's length, and the Minimum and Maximum values.
651
internal double UpdateThumbSize(double trackLength)
653
double result = Double.NaN;
655
if((Orientation == Orientation.Horizontal && ElementHorizontalThumb != null) ||
656
(Orientation == Orientation.Vertical && ElementVerticalThumb != null))
660
// hide the thumb if too big
661
if (Maximum - Minimum == 0)
663
ElementHorizontalThumb.Visibility = Visibility.Collapsed;
664
ElementVerticalThumb.Visibility = Visibility.Collapsed;
668
result = ConvertViewportSizeToDisplayUnits(trackLength);
670
ElementHorizontalThumb.Visibility = Visibility.Visible;
671
ElementVerticalThumb.Visibility = Visibility.Visible;
674
if (Orientation == Orientation.Horizontal)
676
ElementHorizontalThumb.Width = result;
677
result = ElementHorizontalThumb.ActualWidth;
681
ElementVerticalThumb.Height = result;
682
result = ElementVerticalThumb.ActualHeight;
691
#endregion UpdateTrackLayout
693
#region Template Parts
696
/// Root of the ScrollBar template.
698
internal FrameworkElement ElementRoot { get; set; }
699
internal const string ElementRootName = "RootElement";
702
/// Horizontal template root
704
internal FrameworkElement ElementHorizontalTemplate { get; set; }
705
internal const string ElementHorizontalTemplateName = "HorizontalRootElement";
708
/// Large increase repeat button
710
internal RepeatButton ElementHorizontalLargeIncrease { get; set; }
711
internal const string ElementHorizontalLargeIncreaseName = "HorizontalLargeIncreaseElement";
714
/// Large decrease repeat button
716
internal RepeatButton ElementHorizontalLargeDecrease { get; set; }
717
internal const string ElementHorizontalLargeDecreaseName = "HorizontalLargeDecreaseElement";
720
/// Small increase repeat button
722
internal RepeatButton ElementHorizontalSmallIncrease { get; set; }
723
internal const string ElementHorizontalSmallIncreaseName = "HorizontalSmallIncreaseElement";
726
/// Small decrease repeat button
728
internal RepeatButton ElementHorizontalSmallDecrease { get; set; }
729
internal const string ElementHorizontalSmallDecreaseName = "HorizontalSmallDecreaseElement";
732
/// Thumb for dragging track
734
internal Thumb ElementHorizontalThumb { get; set; }
735
internal const string ElementHorizontalThumbName = "HorizontalThumbElement";
738
/// Vertical template root
740
internal FrameworkElement ElementVerticalTemplate { get; set; }
741
internal const string ElementVerticalTemplateName = "VerticalRootElement";
744
/// Large increase repeat button
746
internal RepeatButton ElementVerticalLargeIncrease { get; set; }
747
internal const string ElementVerticalLargeIncreaseName = "VerticalLargeIncreaseElement";
750
/// Large decrease repeat button
752
internal RepeatButton ElementVerticalLargeDecrease { get; set; }
753
internal const string ElementVerticalLargeDecreaseName = "VerticalLargeDecreaseElement";
756
/// Small increase repeat button
758
internal RepeatButton ElementVerticalSmallIncrease { get; set; }
759
internal const string ElementVerticalSmallIncreaseName = "VerticalSmallIncreaseElement";
762
/// Small decrease repeat button
764
internal RepeatButton ElementVerticalSmallDecrease { get; set; }
765
internal const string ElementVerticalSmallDecreaseName = "VerticalSmallDecreaseElement";
768
/// Thumb for dragging track
770
internal Thumb ElementVerticalThumb { get; set; }
771
internal const string ElementVerticalThumbName = "VerticalThumbElement";
774
/// Transition into the Normal state in the ScrollBar template.
776
internal Storyboard StateNormal { get; set; }
777
internal const string StateNormalName = "Normal State";
780
/// Transition into the MouseOver state in the ScrollBar template.
782
internal Storyboard StateMouseOver { get; set; }
783
internal const string StateMouseOverName = "MouseOver State";
786
/// Transition into the Disabled state in the ScrollBar template.
788
internal Storyboard StateDisabled { get; set; }
789
internal const string StateDisabledName = "Disabled State";
791
#endregion Template Parts
793
#region Member Variables
795
/// Whether the mouse is currently over the control
797
internal bool IsMouseOver { get; set; }
800
/// Current state of the control
802
internal Storyboard _currentState;
805
/// Accumulates drag offsets in case the mouse drags off the end of the track.
807
private double _dragValue;
808
#endregion Member Variables