Question

I have a hierarchical TreeView object with some structure:

  • Main level
    • second level 1
    • second level 3
    • second level 2

The problem is: when I select item on second level it fires "selected" event for Main level item. How can I denied it? I try use some tricks with boolean flag and original source property, but I failed it. e.Handled = true also do not give me result.

Thanks for any advices and sorry for my bad English!

Was it helpful?

Solution 2

The problem was in some strange bug in my code. When I use splashscreen in my app, event for main level fires. When I disable splashscreen - it works perfectly with e.Handled = true; trick.

So I call second splashscreen in the end of item selected evend handler for 0 ms, and it works.

Thanks all.

OTHER TIPS

Events, added using AddHandler, ignore e.Handled flag, which is likely your case. Can you check if event's Source is equal to OriginalSource and if so quit the handler?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top