aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-04 12:09:58 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-04 12:09:58 +0200
commit8c443ef4dae0ff2e30846824e684063405b4755f (patch)
tree4fcb563877a405ab9767b2f50c1e36340405d178 /Software/Visual_Studio/Tango.Touch
parent6fe4ca9ac3847955d44dd94479d65a3284661808 (diff)
downloadTango-8c443ef4dae0ff2e30846824e684063405b4755f.tar.gz
Tango-8c443ef4dae0ff2e30846824e684063405b4755f.zip
Added mouse wheel scroll to LightTouchScrollViewer.
Related Work Items: #1498
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs
index 934c22295..a20f52d7b 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs
+++ b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs
@@ -668,7 +668,39 @@ namespace Tango.Touch.Controls
IsScrolling = false;
}
}
+ /// <summary>
+ /// Invoked when an unhandled <see cref="E:System.Windows.Input.Mouse.MouseWheel" /> attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
+ /// </summary>
+ /// <param name="e">The <see cref="T:System.Windows.Input.MouseWheelEventArgs" /> that contains the event data.</param>
+ protected override void OnMouseWheel( MouseWheelEventArgs e)
+ {
+ base.OnMouseWheel(e);
+ if (DisableScrolling)
+ {
+ return;
+ }
+ base.OnMouseWheel(e);
+ if (!e.Handled )
+ {
+ if (e.Delta != 0)
+ {
+ var scrollPos = GetScrollPosition();
+ if (e.Delta > 0)
+ {
+ scrollPos -= 15;
+ }
+ else if(e.Delta < 0)
+ {
+ scrollPos += 15;
+ }
+ ScrollToPosition(scrollPos);
+ SetThumbPosition();
+ }
+ }
+
+ e.Handled = false;
+ }
#endregion
#region Private Methods