Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 WPF 数据网格。我希望能够检测到我的鼠标当前悬停在哪个单元格(行和索引)上,然后设置焦点/突出显示该单元格。我能够找到有关如何查找行和索引的本教程,但它似乎真的很复杂。还有另一种方法可以做到这一点吗?
覆盖 DataGridCell 模板,然后重新设计它。比较简单,只需要为 IsMouseOver 添加新的触发器即可。