문제

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!

도움이 되었습니까?

해결책 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.

다른 팁

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top