void contributions_PreviewTouchUp(object sender, System.Windows.Input.TouchEventArgs e)
{
//TextBlock tm = new TextBlock(); tm.Foreground = Brushes.White;
//Canvas.SetLeft(tm, 200); Canvas.SetTop(tm, debug_var);
//tm.Text = "TOUCH UP"; tm.FontSize = 16; tm.FontWeight = FontWeights.Bold;
////window_manager.main_canvas.Children.Add(tm);
//debug_canvas.Children.Add(tm);
//debug_var = debug_var + 30;
//if (debug_var > 600) { debug_var = 10; debug_canvas.Children.RemoveRange(0, debug_canvas.Children.Count); }
if (touch_points.Count > 0)
{
ScrollViewer scroll = configurations.GetDescendantByType(this.contributions, typeof(ScrollViewer)) as ScrollViewer;
//double dv = e.GetTouchPoint(this.contributions).Position.X - touch_points[touch_points.Count - 1].Position.X;
double dv = e.GetTouchPoint(this.contributions).Position.X - touch_points[0].Position.X;
try
{
//scroll.ScrollToHorizontalOffset(scroll.HorizontalOffset + (-2 * dv));
scroll.ScrollToHorizontalOffset(last_scroll_offset + (-1 * dv));
}
catch (Exception) { }
last_scroll_offset = scroll.HorizontalOffset;
}
this.touch_points.Clear();
consecutive_drag_points = 0;
UIElement element = sender as UIElement;
element.ReleaseTouchCapture(e.TouchDevice);
//e.Handled = false;
}