重叠的滚动查看器中的Elements的工具提示 [英] Elements' tooltips inside overlapping scrollviewers
本文介绍了重叠的滚动查看器中的Elements的工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有两个重叠的scrollviewer,并且需要为两个scrollviewer中的每个可见元素显示一个工具提示.问题在于只有最上方的scrollviewer元素才显示工具提示.我已经用Google搜索过,并且已经阅读了一些页面,例如在可视层中进行命中测试没有运气.
这里是一个仅显示第二个工具提示(绿色矩形)的代码示例:
< 网格 高度 =" 宽度 =" >
< ScrollViewer >
< 矩形 =" 红色" 宽度 > 100" HorizontalAlignment =" 左侧" 工具提示 红色" / >
< /ScrollViewer >
< ScrollViewer >
< 矩形 =" 绿色" 宽度 > 100" HorizontalAlignment =" 右" 工具提示 绿色" / >
< /ScrollViewer >
< /Grid >
有什么主意吗?
谢谢,
Raúl
解决方案
就目前而言,您不能这样做.当项目重叠时,获得工具提示支持的元素是z顺序顶部的元素.基本上,这里的问题是红色滚动查看器被蓝色滚动查看器覆盖,因此,即使将鼠标悬停在红色矩形上,也会有z顺序较高的项妨碍您的操作,并阻止工具提示服务与红色矩形.
我对您要在此处实现的目标感到困惑-通过重叠的滚动查看器,您将第二个滚动条显示在第一个滚动条的顶部,因此无论如何您只能滚动第二个滚动条.
>
Hi all,
I have two overlapping scrollviewers and I need to show a tooltip for each visible element inside both scrollviewers. The problem is that only topmost scrollviewer''s elements show the tooltip. I have googled and I have read some pages like Hit Testing in the Visual Layer without luck.
Here a code example where only the second tooltip is shown (green rectangle):
<Grid Height="100" Width="300">
<ScrollViewer>
<Rectangle Fill="Red" Width="100" HorizontalAlignment="Left" ToolTip="Red" />
</ScrollViewer>
<ScrollViewer>
<Rectangle Fill="Green" Width="100" HorizontalAlignment="Right" ToolTip="Green" />
</ScrollViewer>
</Grid>
Any idea?
Thanks,
Raúl
解决方案
As it stands, you can''t. The element that gets the tooltip support when the items overlap is the element at the top of the z-order. Basically, the problem here is that the red scrollviewer is overlaid by the blue scrollviewer, so even though you hover over the red rectangle, there is an item with a higher z-order getting in the way and preventing the tooltip service from interacting with the red rectangle.
I am confused as to what you are trying to achieve here - by having overlapping scroll viewers, you show the second scrollbar on top of the first, so you could only scroll the second item anyway.
这篇关于重叠的滚动查看器中的Elements的工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文