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.
我在我的 XAML 中使用事件触发器,我在 ListItem 上设置了以下样式。我想要的是在鼠标进入列表项时在消息框中显示 ListItem 的内容。
<Style.Triggers> <EventTrigger RoutedEvent="Mouse.MouseEnter"> </EventTrigger> </Style.Triggers>
我想知道当鼠标进入列表项时是否可以触发代码。
<ListBox> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <EventSetter Event="MouseEnter" Handler="_listBoxItem_MouseEnter"/> </Style> </ListBox.ItemContainerStyle> </ListBox>