获取光标位置并检查是否在具有Visibility = Collapsed的放置目标内 [英] Get Cursor Position and check if inside drop target with Visibility=Collapsed

查看:87
本文介绍了获取光标位置并检查是否在具有Visibility = Collapsed的放置目标内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下博客 http: //blog.pixelingene.com/2006/12/drag-drop-with-attached-properties-part-3/ 用于实现拖放行为.

I am using the following blog http://blog.pixelingene.com/2006/12/drag-drop-with-attached-properties-part-3/ for implementing the drag and drop behavior.

我有一个布局控件(网格/画布/码头面板),在该控件上定义了矩形停靠区域.我定义了4个对接面板.一个对接面板包含我的元素.元素需要在停靠中的布局控件的每一侧上拖动 地区.但是,可以放置元素的停靠区域是不可见的,直到鼠标进入下面是停放面板的区域时,鼠标才可以放置该元素.

I have a  layout control (grid/canvas/dockpanel) on which  are defined for rectangular docking areas. I define 4 docking panels. One docking panel contains my element. The element needs to be dragged on each side of the layout control in the docking areas. However the docking areas where the element can be dropped are invisble, until the moment the mouse enters an area where underneath is a docking panel where it can drop the element. Any suggestions how to achive this?

推荐答案

如果鼠标悬停在上面时有一个图钉图标可能会更容易一些, 折叠"区域将自动扩展,类似于VS2010的行为.然后,当用户尝试放到缩小"区域时,它将自动展开 到允许放下的地方.

Hi, it might be easier if you could have a drop pin icon whenever mouse hovering over, the 'collapsed' area will automatically expand, similar to how VS2010 will be behave. Then when users attempt to drop on the 'shrinked' area, it will automatically expand to places where drop is allowed.

致谢


这篇关于获取光标位置并检查是否在具有Visibility = Collapsed的放置目标内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆