예제 #1
0
        /// <summary>
        /// WPF provides us with ready to use data when we try to overscroll; Unfortunately MSDN documentation on this is a bit lacking
        /// e.BoundaryFeedback.Translation signifies the amount by which we are overscrolling
        /// </summary>
        /// <param name="e"></param>
        protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e)
        {
            if (_disableManipulationCount > 0)
            {
                return;
            }

            //Square root is a simple function that gives a decreasing growth characteristic
            if (e.BoundaryFeedback.Translation.Y != 0)
            {
                StretchLengthY = Math.Sqrt(Math.Abs(e.BoundaryFeedback.Translation.Y * Elasticity));
            }
            else
            {
                ResetY();
            }

            if (e.BoundaryFeedback.Translation.X != 0)
            {
                StretchLengthX = Math.Sqrt(Math.Abs(e.BoundaryFeedback.Translation.X * Elasticity));
            }
            else
            {
                ResetX();
            }

            Transform.Y = StretchLengthY = e.BoundaryFeedback.Translation.Y > 0 ? StretchLengthY : -StretchLengthY;
            Transform.X = StretchLengthX = e.BoundaryFeedback.Translation.X > 0 ? StretchLengthX : -StretchLengthX;

            //If not handled, default WPF behaviour of window shake will occur in conjuction with this
            // if (!RaiseParent(e))
            {
                e.Handled = true;
            }
        }
예제 #2
0
        private void ManipulationBoundaryFeedbackHandler(object sender, ManipulationBoundaryFeedbackEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("Feedback: {0} sender: {1}  Source: {2}", e.BoundaryFeedback.Translation, sender.GetType(), e.Source.GetType());
            FrameworkElement element = sender as FrameworkElement;

            element.RenderTransform = new TranslateTransform(e.BoundaryFeedback.Translation.X, e.BoundaryFeedback.Translation.Y);
            e.Handled = true;
        }
        /// <summary>
        /// Called when either the control's content or the <see cref="FeedbackProvider"/>
        /// emits the <see cref="UIElement.ManipulationBoundaryFeedback"/> event.
        /// This method handles the event from either source.
        /// </summary>
        /// <param name="e">The event args which define the manipulation boundary feedback.</param>
        protected virtual void OnManipulationBoundaryFeedbackReceived(ManipulationBoundaryFeedbackEventArgs e)
        {
            if (PreventBubbling)
            {
                this.TraceVerbose("Preventing bubbling of the event.");
                e.Handled = true;
            }
            else
            {
                this.TraceVerbose("Not preventing bubbling of the event.");
            }

            // We copy the event data into (dependency) properties.
            // This allows a corresponding control template to visually represent the
            // manipulation boundary feedback data.
            TranslationDeltaX = e.BoundaryFeedback.Translation.X;
            TranslationDeltaY = e.BoundaryFeedback.Translation.Y;
            Rotation          = e.BoundaryFeedback.Rotation;
            ScaleDeltaX       = e.BoundaryFeedback.Scale.X;
            ScaleDeltaY       = e.BoundaryFeedback.Scale.Y;
            ExpansionDeltaX   = e.BoundaryFeedback.Expansion.X;
            ExpansionDeltaY   = e.BoundaryFeedback.Expansion.Y;
        }
예제 #4
0
 private void Yaoscrollviewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
예제 #5
0
 private void OnHostManipulationBoundaryFeedback(
     object sender,
     ManipulationBoundaryFeedbackEventArgs args)
 {
 }
예제 #6
0
 protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
 /*
  * 文件夹树 - 触摸滚动反馈
  */
 private void folderTreeColumn_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
예제 #8
0
 private void OnResultsListBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
예제 #9
0
 private void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     // Avoid window shaking: https://stackoverflow.com/a/37000344/942659
     e.Handled = true;
 }
예제 #10
0
 private void OnManipulationBoundaryFeedback(
     object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     // Prevent the window to slightly move when its edge is encountered using touch scrolling.
     e.Handled = true;
 }
 /// <summary>
 /// Called when the control's content emits the
 /// <see cref="UIElement.ManipulationBoundaryFeedback"/> event.
 /// </summary>
 /// <param name="e">The event args which define the manipulation boundary feedback.</param>
 protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e)
 {
     // Also handle events if they come from the content.
     this.TraceVerbose("Received manipulation boundary feedback from the content.");
     OnManipulationBoundaryFeedbackReceived(e);
 }
 private void FeedbackProvider_ManipulationBoundaryFeedback(
     object sender, ManipulationBoundaryFeedbackEventArgs args)
 {
     this.TraceVerbose("Received manipulation boundary feedback from the FeedbackProvider.");
     OnManipulationBoundaryFeedbackReceived(args);
 }
예제 #13
0
 private void InkCanvas_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     textBox.Text += "InkCanvas_ManipulationBoundaryFeedback\n";
 }
예제 #14
0
 private void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
 }
예제 #15
0
 private void Window_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     NewEvent("Window_ManipulationBoundaryFeedback");
 }
예제 #16
0
 private void ManipulationBoundaryFeedbackHandler(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     // disable feedback that list scroll has reached the limit
     // -- the feedback is that the whole window moves
     e.Handled = true;
 }
예제 #17
0
 // Override is optional to remove unnecessary behavior
 protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e)
 {
     // uncomment this to use base class implementation
     //base.OnManipulationBoundaryFeedback(e);
     e.Handled = true;
 }
예제 #18
0
 private void SCManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
 }
예제 #19
0
 private void patientsListView_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     //e.Handled = true;
 }
 private void OnDescriptionViewBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
예제 #21
0
 private void ScrollViewerPro_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
예제 #22
0
 private void factoryPresetsListBox_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
 private void roiLayersItemsControl_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
예제 #24
0
 public void ManipulationBoundaryFeedbackHandler
     (object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
 protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e)
 {
     base.OnManipulationBoundaryFeedback(e);
 }
예제 #26
0
 private void Dg_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     e.Handled = true;
 }
예제 #27
0
 private void tvLibrarySearchResults_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
 {
     // By default, when you touch pan to the end of the scrollable area, the whole window moves around. I think this looks ugly for this app!
     e.Handled = true;
 }