Handling Single versus doubleclick (WPF)

This forum is meant for questions and discussions about the X# language and tools
ic2
Posts: 2008
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Handling Single versus doubleclick (WPF)

Post by ic2 »

I promised to let you know if Syncfusion came with a solution and they did. Basically my main issue was that distinguishing between a single or double click was about impossible, mainly because in the OnKanbanCardTapped method, the contextmenu was built. Probably that took up all time or something and I thought it was much more logical to build/show this contextmenu with a right mouse click instead, for which there was no event.

Earlier Syncfusion provided me with code to define the Kanban card's lay out and content, by code, which was called instead of the built in card with:

Code: Select all

kanban.CardTemplate = new DataTemplate()																								// Use CardView in Helper to change lay-out (from Syncfusion support's sample) 10-3-2026
{
  VisualTree = new FrameworkElementFactory(typeof(KanbanCardView))
};
Assigning the right mouse menu was only possible by further modifying that code by adding a method called OnPreviewMouseRightButtonDown and adding that as event handler. Then I got my context menu only with a right mouse click.
They also suggested I could add the menu with a double click using the OnKanbanCardDoubleTapped method. By moving away the context menu creation code from the OnKanbanCardTapped method, this works but also not always, as the OnKanbanCardTapped again kicks in first and prevents the OnKanbanCardDoubleTapped to call. Anyhow, I don't need the contextmenu from a double click; the right mouse click is the logical solution.

In their on line Blazor sample showing many features, a contextmenu is not implemented in any of them. But it is very handy for common action like Add, Delete. See https://help.syncfusion.com/wpf/kanban- ... ng-started

Dick
Post Reply