Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to check the mouse click event? #114

Open
luckygg opened this issue Sep 16, 2021 · 3 comments
Open

Is it possible to check the mouse click event? #114

luckygg opened this issue Sep 16, 2021 · 3 comments

Comments

@luckygg
Copy link

luckygg commented Sep 16, 2021

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 :)

@StellarWitch7
Copy link

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.

@chaojian-zhang
Copy link

chaojian-zhang commented Jan 29, 2024

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!

@StellarWitch7
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants