private void HandleCrossSlide(CrossSlideMode mode) { _contentGrid.ManipulationDelta -= _contentGrid_ManipulationDelta; if (PivotItem != null) { //PivotItem.Margin = _defaultPivotItemMargin; PivotItem.RenderTransform = new TranslateTransform(); var pivot = PivotItem.Parent as Pivot; //Manipulation Is Inertial //when swip quickly, may it will change index manytime, we only handle the selectindex is //PivotItem index if (pivot != null && pivot.SelectedIndex == pivot.IndexFromContainer(PivotItem)) { this.Visibility = Visibility.Collapsed; var index = pivot.SelectedIndex; if (mode == CrossSlideMode.Left) { index = index - 1; if (index < 0) { index = pivot.Items.Count - 1; } } else { index = index + 1; if (index > pivot.Items.Count - 1) { index = 0; } } pivot.SelectedIndex = index; this.Visibility = Visibility.Visible; } } }
public CrossSlideEventArgs(CrossSlideMode mode) { Mode = mode; }