Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Continue with Click after touch

$
0
0

Hi,

I am trying to enable some simple touch gestures to my wpf-app. Since it is like looking through pages I want to catch short gestures, but ignore "clicks".

Now just for testing I put this in the frame every page will be loaded into:

        private void presentationFrame_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
        {
            try
            {
                if (Math.Abs(e.TotalManipulation.Translation.X) > 50 || Math.Abs(e.TotalManipulation.Translation.Y) > 30)
                {
                    e.Handled = true;
                if (Math.Abs(e.TotalManipulation.Translation.X) > Math.Abs(e.TotalManipulation.Translation.Y))
                {
                    if (e.TotalManipulation.Translation.X > 0)
                    {
                        MessageBox.Show("x > 0");
                    }
                    else
                    {
                        MessageBox.Show("x < 0");
                    }
                }
                else
                {
                    if (e.TotalManipulation.Translation.Y > 0)
                    {
                        MessageBox.Show("y > 0");
                    }
                    else
                    {
                        MessageBox.Show("y < 0");
                    }
                }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

Very simple. But when I just "click" on the screen I was hoping the touch would be "promoted to a mouseclick" as I read somewhere.

The loaded pages will contain buttons, lists, texts etc. So when a user tabs on the screen I want the click...

How do I achieve this? (Why does this code not work?)

Thank you!


JEns D.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>