Hi Megha,
Try with following code, let's say if you have a XAML user control named "usercontrol", I attach a tap(click) event to the whole page, when the mouse click somewhere, the pageRoot_Tapped event fires, by using the PointerEnter/PointerExist I know
if the mouse action is inside the usercontrol or not:
public MainPage()
{
this.InitializeComponent();
this.AddHandler(UIElement.TappedEvent, new TappedEventHandler(pageRoot_Tapped), true);
}
private bool ismousein = false;
private void usercontrol_PointerEntered(object sender, PointerRoutedEventArgs e)
{
ismousein = true;
}
private void usercontrol_PointerExited(object sender, PointerRoutedEventArgs e)
{
ismousein = false;
}
private void pageRoot_Tapped(object sender, TappedRoutedEventArgs e)
{
if(!ismousein)
{
//implement something here
}
}
--James
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.