This is a migrated thread and some comments may be shown as answers.

Problem with touch.

2 Answers 279 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pablo
Top achievements
Rank 1
Pablo asked on 29 Dec 2017, 06:24 AM
Hello Guys, im new with Telerik and i missed a little with a SuspendMousePromotionUntilTouchUp.


What exactly do SuspendMousePromotionUntilTouchUp?

I really appreciate with some simple example of usage please.

2 Answers, 1 is accepted

Sort by
0
Pablo
Top achievements
Rank 1
answered on 29 Dec 2017, 07:03 AM

From microsoft side

Disables automatic mouse-event promotion for the primary touch point until all touch points report as Up.


In your documentation:
Disables automatic mouse-event promotion for the primary touch point until all touch points report as Up. Promotion can be disabled only for the primary touch point while reporting Down.

Anyway not understand, what is and how use, i appreciate some explain with example.


For me mouse promotion on the primary touch basically happen when you touch with one finger, that automatically generate a mouse event and also make the mouse cursor move under the finger touch.
What I trying to do is exactly that, prevent mouse cursor move under first finger touch the screen.

  private void touchdownn(object sender, Telerik.Windows.Input.Touch.TouchEventArgs args)
        {
            args.SuspendMousePromotionUntilTouchUp();
            myrectangle.Fill = new SolidColorBrush(System.Windows.Media.Colors.AliceBlue);

        }


Of course using in this way no prevent the mouse cursor move under my finger.
Is possible do with telerik what i need do.

Please apologize my non perfect english.










0
Vladimir Stoyanov
Telerik team
answered on 02 Jan 2018, 01:33 PM
Hello Pablo,

The SuspendMousePromotionUntilTouchUp method prevents all the mouse events from being thrown. If I understand correctly you want to prevent the mouse from moving to the touch location. Feel free to correct me on that if I am wrong. I am afraid there isn't an easy way to achieve this since the WPF framework is handling the mouse movement to the touch location. You can observe that by setting IsHitTestVisible="False" on the element that you are using to test and then touch it. You can observe that no touch or mouse events will be thrown but the mouse cursor moves to the touch location.
What I can suggest is to set the mouse position explicitly. You can check out the following topic for more information on the matter.

I hope this helps. Don't hesitate to contact us again if you have any other questions.

Regards,
Vladimir Stoyanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
General Discussions
Asked by
Pablo
Top achievements
Rank 1
Answers by
Pablo
Top achievements
Rank 1
Vladimir Stoyanov
Telerik team
Share this question
or