I have to execute some code at left click of mouse and I have to perform separate actions on double click but my Canvas doesn't support doubleclick event, so, I am trying to get the work done by clickcount but it also, enters left click event before coming to clickcount = 2 . How do I prevent this? I know I have to use e.handled = true but i can't understand where. Any help would be appreciated.
void Canvas_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
if(e.ClickCount == 2)
{
// Some code
}
else
{
if(e.ChangedButton == MouseButton.Left)
{
// some code
}
}
}