本文介绍了鼠标指向的TreeView项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用拖放功能开发Silverlight应用程序,在这里我需要获取鼠标指向的TreeViewItem的详细信息.在放置期间未选择TreeViewItems.所以我不想使用SelectedItem属性.
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?
推荐答案
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;
}
这篇关于鼠标指向的TreeView项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!