NodeNetwork icon indicating copy to clipboard operation
NodeNetwork copied to clipboard

Is it possible to check the mouse click event?

Open luckygg opened this issue 3 years ago • 3 comments

Hi all.

I have read the documentation from here. I think this library is really attractive.

But I have a question, is it possible to check the mouse click event? For example, whether can know the selected node by left-click or double-click.

Thank you :)

luckygg avatar Sep 16 '21 23:09 luckygg

I was trying to do something that using a click event likely would have made easier. The solution I ended up using was to hook in to the SelectedNodes list and listen for changes. Then I would check if the count of the list was equal to one. It's not the greatest solution, and doesn't work for detecting double-clicks, but it works for myself.

StellarWitch7 avatar Jun 22 '23 05:06 StellarWitch7

Having exactly the same issue. When everything is doing in a MVVM way it works fine - but when we want to listen to events there is no event to listen to!😂

@StellarWitch7 Dumb question - how do you hook into the SelectedNode and listen for changes? Thanks!

chaojian-zhang avatar Jan 29 '24 19:01 chaojian-zhang

Having exactly the same issue. When everything is doing in a MVVM way it works fine - but when we want to listen to events there is no event to listen to!😂

@StellarWitch7 Dumb question - how do you hook into the SelectedNode and listen for changes? Thanks!

I'm fairly certain I do it here: https://github.com/StellarWitch7/The-Evergreen-Project/blob/main/Evergreen.App%2FMainWindow.xaml.cs I dropped the project a long while ago, so I don't quite understand what it is I wrote up, but maybe you'll be able to figure it out ^^

It should give you the last selected node or null if there's none.

StellarWitch7 avatar Jan 29 '24 19:01 StellarWitch7