Replies: 3 comments 1 reply
-
PointerEvents have a click count iirc. private void InputElement_OnPointerPressed(object? sender, PointerPressedEventArgs e)
{
if (e.ClickCount == 2)
{
// handle double-click
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
I've used the private async void ProjectTree_DoubleTapped(object? sender, TappedEventArgs e)
{
var item = ((Visual)e.Source!).GetSelfAndVisualAncestors()
.OfType<TreeViewItem>()
.FirstOrDefault();
if (item is not null)
{
if (item.DataContext is FolderNodeViewModel or ProjectNodeViewModel)
{
item.IsExpanded ^= true;
}
else if (_viewModel is not null)
{
await _viewModel.ActivateSelectedNode();
}
e.Handled = true;
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
thanks I have tried ` DoubleTapped ` but seems it's like being designed for
touch input witch more forgivable betten click time
…On Sun, Jun 8, 2025 at 9:55 PM Stephen Monaco ***@***.***> wrote:
I've used the DoubleTapped event on the TreeView with some success before:
private async void ProjectTree_DoubleTapped(object? sender, TappedEventArgs e)
{
var item = ((Visual)e.Source!).GetSelfAndVisualAncestors()
.OfType<TreeViewItem>()
.FirstOrDefault();
if (item is not null)
{
if (item.DataContext is FolderNodeViewModel or ProjectNodeViewModel)
{
item.IsExpanded ^= true;
}
else if (_viewModel is not null)
{
await _viewModel.ActivateSelectedNode();
}
e.Handled = true;
}
}
—
Reply to this email directly, view it on GitHub
<#11922 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYGT5YUJVMIUMSLABE3SOFD3CSIJTAVCNFSM6AAAAAB63NMNEKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNBQGM4TMNI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How do I respond to double-click events on the treeview node?
Beta Was this translation helpful? Give feedback.
All reactions