switch ( parameter )
{
case TouchEventArgs eventArgs:
// This is a Touch Event.
this.SelectedButtonLabel = "Touch Down in Touch Down Area.";
break;
case MouseEventArgs eventArgs:
// this is a Mouse Event. What we don't know is if it is promoted from a Touch Event or from a "real mouse".
if ( eventArgs.StylusDevice == null )
{
// This is from a mouse, i.e. not promoted from a Touch Event. We ignore it if it was promoted, or we get
// two clicks.
this.SelectedButtonLabel = "Left Mouse Button Down in Touch Down Area.";
}
break;
} |