/// <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; } }
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; }
private void Yaoscrollviewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
private void OnHostManipulationBoundaryFeedback( object sender, ManipulationBoundaryFeedbackEventArgs args) { }
protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
/* * 文件夹树 - 触摸滚动反馈 */ private void folderTreeColumn_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
private void OnResultsListBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
private void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { // Avoid window shaking: https://stackoverflow.com/a/37000344/942659 e.Handled = true; }
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); }
private void InkCanvas_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { textBox.Text += "InkCanvas_ManipulationBoundaryFeedback\n"; }
private void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { }
private void Window_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { NewEvent("Window_ManipulationBoundaryFeedback"); }
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; }
// 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; }
private void SCManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { }
private void patientsListView_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { //e.Handled = true; }
private void OnDescriptionViewBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
private void ScrollViewerPro_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
private void factoryPresetsListBox_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
private void roiLayersItemsControl_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
public void ManipulationBoundaryFeedbackHandler (object sender, ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
protected override void OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs e) { base.OnManipulationBoundaryFeedback(e); }
private void Dg_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) { e.Handled = true; }
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; }