Click here to Skip to main content
15,887,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on a Silverlight Application with Drag and Drop, where I need to get the TreeViewItem's details pointed by the mouse. The TreeViewItems are not selected during the drop. So I don't want to use SelectedItem property. Is there any easier way to do that?
Posted

1 solution

I had the same problem when I was writing application in SL. Well I didn't find any better way but this one.

You will have to use a Template whose child control will handle MouseEnter and MouseOut(I forgot exact event names). In MouseEnter event you will set the global item and in MouseOut you will set it to null.

eg


MyItem item = null;
void MouseEnter(.....)
{
// you can also check for MouseDown before doing any further
item = ....;// set your item using sender
}

void MouseOut(....)
{
item = null;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900