Exemplo n.º 1
0
        void CRMScrollViewer_ManipulationBoundaryFeedback(object sender, System.Windows.Input.ManipulationBoundaryFeedbackEventArgs e)
        {
            Vector translation = e.BoundaryFeedback.Translation;

            if (translation.Y < 0) // Negativo = scroll hacia abajo (dedo hacia arriba)
            {
                _sbFadeBottom.Stop(_recBottom);
                _recBottom.Opacity = 1;
                _recBottom.Height  = calculateOffsetHeight(-translation.Y);
            }
            else if (translation.Y > 0)
            {
                _sbFadeTop.Stop(_recTop);
                _recTop.Opacity = 1;
                _recTop.Height  = calculateOffsetHeight(translation.Y);
            }
            else // translation.Y == 0
            {
            }

            // Stops listbox scroll inertia. Pull down entire window!
            e.Handled = true;
        }
Exemplo n.º 2
0
 private void Popup_ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
Exemplo n.º 3
0
 void lst_ManipulationBoundaryFeedback(object sender, System.Windows.Input.ManipulationBoundaryFeedbackEventArgs e)
 {
     // Stops listbox scroll inertia. Pull down entire window!
     e.Handled = true;
 }
 private void StackPanel_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
 private void ScrollViewer_ManipulationBoundaryFeedback(object sender, System.Windows.Input.ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
Exemplo n.º 6
0
 void c_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
Exemplo n.º 7
0
 protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
 private void ManipulationBoundaryFeedbackHandler(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
Exemplo n.º 9
0
        /// <summary>
        ///     Provides feedback when a manipulation has encountered a boundary by nudging the window.
        /// </summary>
        /// <remarks>
        ///     PanningFeedback is reported on Handle of the Window using Begin/Update/EndPanningFeedback
        ///     APIs. When the Handle reported to these APIs is not of a top-level window, these APIs
        ///     do a GetAncestor call to get the top-level window and apply the effect of it. For eg.
        ///     in the case of XBAPs we report the feedback to the Handle of RootBrowserWindow which is
        ///     a child window, but still the panning feedback effect gets applied to the browser window
        ///     itself. Security wise this also assumes that PanningFeedback will not move the Window
        ///     by an arbitrary distance.
        /// </remarks>
        protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e)
        {
            base.OnManipulationBoundaryFeedback(e);

            // If the original source is not from the same PresentationSource as of the Window,
            // then do not act on the PanningFeedback.
            if (!PresentationSource.UnderSamePresentationSource(e.OriginalSource as DependencyObject, this))
            {
                return;
            }

            if (!e.Handled)
            {
                if (_currentPanningTarget == null ||
                    !_currentPanningTarget.IsAlive ||
                    _currentPanningTarget.Target != e.OriginalSource)
                {
                    if (_swh != null)
                    {
                        // Cache location if starting the panning feedback.
                        // Using SourceWindowHelper.WindowBounds instead of Window.Left
                        // and Window.Top so that the implementation works with
                        // RootBrowserWindow.
                        NativeMethods.RECT rc = WindowBounds;
                        _prePanningLocation = DeviceToLogicalUnits(new Point(rc.left, rc.top));
                    }
                }
                ManipulationDelta manipulation = e.BoundaryFeedback;
                UpdatePanningFeedback(manipulation.Translation, e.OriginalSource);
                e.CompensateForBoundaryFeedback = CompensateForPanningFeedback;
            }
        }
 protected virtual void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e);
Exemplo n.º 11
0
        private void PostProcessInput(object sender, ProcessInputEventArgs e)
        {
            InputEventArgs inputEventArgs = e.StagingItem.Input;

            if (inputEventArgs.Device == this)
            {
                RoutedEvent routedEvent = inputEventArgs.RoutedEvent;
                if (routedEvent == Manipulation.ManipulationDeltaEvent)
                {
                    ManipulationDeltaEventArgs deltaEventArgs = inputEventArgs as ManipulationDeltaEventArgs;
                    if (deltaEventArgs != null)
                    {
                        // During deltas, see if panning feedback is needed on the window
                        ManipulationDelta unusedManipulation = deltaEventArgs.UnusedManipulation;
                        _manipulationLogic.RaiseBoundaryFeedback(unusedManipulation, deltaEventArgs.RequestedComplete);
                        _manipulationLogic.PushEventsToDevice();

                        // If a Complete is requested, then pass it along to the manipulation processor
                        if (deltaEventArgs.RequestedComplete)
                        {
                            _manipulationLogic.Complete(/* withInertia = */ deltaEventArgs.RequestedInertia);
                            _manipulationLogic.PushEventsToDevice();
                        }
                        else if (deltaEventArgs.RequestedCancel)
                        {
                            Debug.Assert(!deltaEventArgs.IsInertial);
                            OnManipulationCancel();
                        }
                    }
                }
                else if (routedEvent == Manipulation.ManipulationStartingEvent)
                {
                    ManipulationStartingEventArgs startingEventArgs = inputEventArgs as ManipulationStartingEventArgs;
                    if (startingEventArgs != null && startingEventArgs.RequestedCancel)
                    {
                        OnManipulationCancel();
                    }
                }
                else if (routedEvent == Manipulation.ManipulationStartedEvent)
                {
                    ManipulationStartedEventArgs startedEventArgs = inputEventArgs as ManipulationStartedEventArgs;
                    if (startedEventArgs != null)
                    {
                        if (startedEventArgs.RequestedComplete)
                        {
                            // If a Complete is requested, pass it along to the manipulation processor
                            _manipulationLogic.Complete(/* withInertia = */ false);
                            _manipulationLogic.PushEventsToDevice();
                        }
                        else if (startedEventArgs.RequestedCancel)
                        {
                            OnManipulationCancel();
                        }
                        else
                        {
                            // Start ticking to produce delta events
                            ResumeAllTicking(); // Resumes the ticking of all the suspended devices on the thread
                            StartTicking();     // Ensures that we continue ticking or restart ticking for this device
                        }
                    }
                }
                else if (routedEvent == Manipulation.ManipulationInertiaStartingEvent)
                {
                    // Switching from using rendering for ticking to a timer at lower priority (handled by ManipulationLogic)
                    StopTicking();

                    // Remove all the manipulators so that we dont re-start manipulations accidentally
                    RemoveAllManipulators();

                    // Initialize inertia
                    ManipulationInertiaStartingEventArgs inertiaEventArgs = inputEventArgs as ManipulationInertiaStartingEventArgs;
                    if (inertiaEventArgs != null)
                    {
                        if (inertiaEventArgs.RequestedCancel)
                        {
                            OnManipulationCancel();
                        }
                        else
                        {
                            _manipulationLogic.BeginInertia(inertiaEventArgs);
                        }
                    }
                }
                else if (routedEvent == Manipulation.ManipulationCompletedEvent)
                {
                    _manipulationLogic.OnCompleted();
                    ManipulationCompletedEventArgs completedEventArgs = inputEventArgs as ManipulationCompletedEventArgs;
                    if (completedEventArgs != null)
                    {
                        if (completedEventArgs.RequestedCancel)
                        {
                            Debug.Assert(!completedEventArgs.IsInertial);
                            OnManipulationCancel();
                        }
                        else if (!(completedEventArgs.IsInertial && _ticking))
                        {
                            // Remove the manipulation device only if
                            // another manipulation didnot start
                            OnManipulationComplete();
                        }
                    }
                }
                else if (routedEvent == Manipulation.ManipulationBoundaryFeedbackEvent)
                {
                    ManipulationBoundaryFeedbackEventArgs boundaryEventArgs = inputEventArgs as ManipulationBoundaryFeedbackEventArgs;
                    if (boundaryEventArgs != null)
                    {
                        _compensateForBoundaryFeedback = boundaryEventArgs.CompensateForBoundaryFeedback;
                    }
                }
            }
        }
Exemplo n.º 12
0
 private void SearchButtonListView1_ManipulationBoundaryFeedback(object sender, System.Windows.Input.ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
Exemplo n.º 13
0
 private static void OnManipulationBoundaryFeedbackThunk(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     ((UIElement)sender).OnManipulationBoundaryFeedback(e);
 }
Exemplo n.º 14
0
 /// <summary>
 /// Called when the <see cref="E:System.Windows.UIElement.ManipulationBoundaryFeedback"/> event occurs.
 /// </summary>
 /// <param name="e">The data for the event. </param>
 protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e);
 private void OnManipulationBoundaryFeedbackEventArgs(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     if (!IsSampling(sender))
     {
         return;
     }
     _itw.WriteLine(".RaiseManipulationBoundaryFeedbackEvent({0})", e.RoutedEvent.OwnerType.Name + "." + e.RoutedEvent.Name + "Event");
     CodeBox.Text = _sw.ToString();
 }