我想让按钮在 windows Phone 中触摸时改变颜色,但唯一可用的手势是GestureType.Tap
在点击完成后调用,因此在用户触摸按钮后颜色会改变。如何在触摸时立即检测到触摸?
while (TouchPanel.IsGestureAvailable)
{
GestureSample gs = TouchPanel.ReadGesture();
switch (gs.GestureType)
{
//this is called AFTER the tap
case GestureType.Tap:
if (Restart.tapped(gs.Position))
Restart.selectDrawColor = Color.OrangeRed;
else
Restart.selectDrawColor = Color.White;
if (uploadScore.tapped(gs.Position))
uploadScore.selectDrawColor = Color.OrangeRed;
else
uploadScore.selectDrawColor = Color.White;
if (MainMenu.tapped(gs.Position))
MainMenu.selectDrawColor = Color.OrangeRed;
else
MainMenu.selectDrawColor = Color.White;
break;
}
}