Unfortunately, you cannot handle multiple button presses. However, there is a way around. You can use the Touch.FrameReported event to get the position of all the points that the user touches the screen (I read somewhere before before I limited myself to two on WP7, but I canβt confirm this). You can also check if the action performed by the user (such as Down, Move, and Up) is being performed, which may be useful depending on what you are doing.
Put it in your Application_Startup
Touch.FrameReported += new TouchFrameEventHandler(Touch_FrameReported);
Put it in your App class
void Touch_FrameReported(object sender, TouchFrameEventArgs e) { TouchPoint primaryTouchPoint = args.GetPrimaryTouchPoint(null); TouchPointCollection touchPoints = args.GetTouchPoints(null); foreach (TouchPoint tp in touchPoints) { if(tp.Action == TouchAction.Down) {
In the "Do stuff here" section, you should check if TouchPoint tp is in the area the button occupies.
//This is the rectangle where your button is located, change values as needed. Rectangle r1 = new Rectangle(0, 0, 100, 100); if (r1.Contains(tp.Position)) { //Do button click stuff here. }
This will hopefully do it for you.
source share