예제 #1
0
        void SwipeControl_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
        {
            var canExecute = (LeftCommand != null && LeftCommand.CanExecute(DataContext)) ||
                             (RightCommand != null && RightCommand.CanExecute(DataContext));

            if (!canExecute)
            {
                //e.Complete();
                //return;
            }

            VisualStateManager.GoToState(this, "LeftTranslationState", false);
            VisualStateManager.GoToState(this, "CenterTranslationState", false);
            VisualStateManager.GoToState(this, "RightTranslationState", false);

            var x = e.Cumulative.Translation.X;

            UpdateValues(x);
        }