I am planning to show the RightImage on a node hottrack and upon a node selection, i.e all other nodes in my treeview won't show any RightImage.
And next when user clicks on Image I want to show ContextMenu.
The problems that I have are..1) How to set a rightImage on hottrack (I am able to do it upon node selection) 2)How to catch the Image click event?
Hello,
The following works for me:
if (e.Element is ImageUIElement && e.Element.Parent is NodeSelectableAreaUIElement)
{
((ImageUIElement)e.Element).Image;
}
In the MouseEnterElement event;
Thanks Boris..That works fine. However I found a way to solve this last evening. I did slightly different to your solution i.e in MouseEnterElement event I got the node based on point and then activated(and also Selected) the Node. And inAfterActivated event I added RightImages. Everything worked fine.
Today I have got another problem i.e to know which Image got clicked(right image or left image). I tried to get the Image object using ImageUIElement with no success. So I fixed it based on the point (Mouse clicked point) to identify left or right. I am sure there should some other better way to find left or right image click.
Hello Bhaskar,
Could you please review the modified sample attached to this post and see if it meets your requirements. Please feel free to let me know if I misunderstood you or if you have any other questions.
Hi Boris,
The attached example met one of my requirements, however in the example rightimage is being added in AfterActivate event, that means untill I Select (or activate) the node I won't see the image, my requirement is to show the right image on hottrack. Or is there any way to make a HottrackNode as an ActiveNode, so that AfterActivate will fire?
Hello bsanga,
Could you please review the sample attached to this post and see if it meets your requirements. Please feel free to let me know if I misunderstood you or if you have any other questions.