【发布时间】:2019-09-03 00:00:00
【问题描述】:
我有一个包裹在 Grid 中的 ListView,在它上面有一个面板覆盖 (How to make overlay control above all other controls?)。我想突出显示即使光标不在其上方的列表视图项。
当光标在红色矩形上时,我希望有这样的高亮显示。
<Grid Name="grid">
<ListView Name="timeSpansListBox" SelectionMode="Extended" HorizontalAlignment="Left" Width="{Binding ElementName=timePanel, Path=ActualWidth}">
...
</ListView>
<!-- our overlay -->
<MyPanel Name="timePanel" Panel.ZIndex="999">
... items (rectangles you can see on the image)
</MyPanel>
</Grid>
我该怎么做?
类似问题:How to get control with lower zindex when mouse clicked in wpf?
我可以将IsHitTestVisible 设置为false,但我需要面板项目保持可点击状态,所以这不是一个选项。
如果只有某种方法可以以编程方式设置IsMouseOver...
【问题讨论】: