Read Touch-Events / C# / Windows Phone

I have this same problem, ‘code’ do not recognize any mouse points on emulator screen. I created project in Visual studio 2013 and Windows 8.1. Phone emulator is WP8.1. My code:

ctor:

TouchPanel.EnabledGestures = GestureType.FreeDrag | GestureType.Tap;

update:

var touchCollection = TouchPanel.GetState();

foreach (TouchLocation tl in touchCollection)
{
		Debug.WriteLine(tl.Position.ToString());
}

What i miss, or what is wrong?

Edit:

Ok, I know what i made wrong. When I was solving the problem ‘black screen’(3.2 on Windows Phone 8 just shows black screen) i swapped Grid xml node to DrawingSurfaceBackgroundGrid, what i thing was correct(it wasn’t). Now i was reverting this change and resolve problem correctly(commanded Grid node and uncommented DrawingSurfaceBackgroundGrid bottom node) and it works.

1 Like