c# - Multi-touch buttons on Windows Phone 8 -
i using bunch of rectangle shapes in windows phone 8 app , need support multi-touch few of them can tapped @ 1 time. not doing handling on thought multi-touch supported default in windows phone 8 apps.
everything written in c# , xaml. when try press 2 rectangles @ same time tap event never gets hit on either of them.
thank thoughts on this.
xaml of tiles:
<rectangle x:name="tile11" horizontalalignment="left" height="103" margin="10,22,0,0" verticalalignment="top" width="103" tap="tileclickhandler" hold="tileholdhandler" mouseleftbuttondown="tile11_mouseleftbuttondown" mouseleftbuttonup="tile11_mouseleftbuttonup"> <rectangle.fill> <imagebrush stretch="fill" imagesource="/assets/tiles/default.png"/> </rectangle.fill> </rectangle> <rectangle x:name="tile12" horizontalalignment="left" height="103" margin="120,22,0,0" verticalalignment="top" width="103" tap="tileclickhandler" hold="tileholdhandler" mouseleftbuttondown="tile11_mouseleftbuttondown" mouseleftbuttonup="tile11_mouseleftbuttonup"> <rectangle.fill> <imagebrush stretch="fill" imagesource="/assets/tiles/default.png"/> </rectangle.fill> </rectangle> <rectangle x:name="tile14" horizontalalignment="left" height="103" margin="340,22,0,0" verticalalignment="top" width="103" tap="tileclickhandler" hold="tileholdhandler" mouseleftbuttondown="tile11_mouseleftbuttondown" mouseleftbuttonup="tile11_mouseleftbuttonup"> <rectangle.fill> <imagebrush stretch="fill" imagesource="/assets/tiles/default.png"/> </rectangle.fill> </rectangle>
one tap handler three:
private void tileclickhandler(object sender, system.windows.input.gestureeventargs e) { if (isrecordingactive) { stoprecording(); isrecordingactive = false; managetilestate(activerecordingtile, constants.tilestates.has_sound); } else { system.windows.shapes.rectangle tile = (system.windows.shapes.rectangle)sender; if (doestilehavesound(tile)) { thread soundthread = new thread(new parameterizedthreadstart(playsound)); soundthread.start(tile.name); } } }
i had come own multitouch logic. meaning using touch detection - , keep track of has been touched in each frame. when element gets touch free decide action take.
Comments
Post a Comment