private void UserControl_PointerCanceled(object sender, PointerRoutedEventArgs e) { TableViewModel.CancelIndexing(true); lastIndex = -1; lastStayedIndex = -1; ShowHelperStoryboard.Pause(); HideHelperStoryboard.Begin(); }
private void IndexHelperElement_PointerPressed(object sender, PointerRoutedEventArgs e) { if (TableViewModel.MainPageViewModel.View.TableView.ColumnHighlighter.ColumnViewModel != null) { return; } CapturePointer(e.Pointer); lastCapturedPointerId = e.Pointer.PointerId; HideHelperStoryboard.Pause(); ShowHelperStoryboard.Begin(); }
private void UserControl_PointerCaptureLost(object sender, PointerRoutedEventArgs e) { ShowHelperStoryboard.Pause(); HideHelperStoryboard.Begin(); Point position = e.GetCurrentPoint(this).Position; TableViewModel tvm = this.DataContext as TableViewModel; var viewModel = tvm.MainPageViewModel.ExplorationViewModel.TopPageView.ViewModel; if (viewModel.IsEmpty) { TableViewModel.CancelIndexing(true); lastIndex = -1; lastStayedIndex = -1; return; } if (viewModel.IsNoPossibleVisualizationWarningVisible) { TableViewModel.CancelIndexing(true); lastIndex = -1; lastStayedIndex = -1; return; } Debug.WriteLine((DateTime.Now - indexedDateTime).TotalMilliseconds); if (lastStayedIndex >= 0 && (DateTime.Now - indexedDateTime).TotalMilliseconds <= Const.ColumnIndexerChatteringThreshold) { TableViewModel.IndexColumn(e.GetCurrentPoint(this).PointerId, lastStayedIndex); Debug.WriteLine("chattering occurred"); Logger.Instance.Log($"chattering occurred, threshold: {Const.ColumnIndexerChatteringThreshold}"); } viewModel.State = PageViewModel.PageViewState.Selected; viewModel.StateChanged(tvm.MainPageViewModel.ExplorationViewModel.TopPageView); TableViewModel.CancelIndexing(true); lastIndex = -1; lastStayedIndex = -1; }