Exemple #1
0
 private void UserControl_PointerCanceled(object sender, PointerRoutedEventArgs e)
 {
     TableViewModel.CancelIndexing(true);
     lastIndex       = -1;
     lastStayedIndex = -1;
     ShowHelperStoryboard.Pause();
     HideHelperStoryboard.Begin();
 }
Exemple #2
0
        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;
        }