Question

I am using event triggers in my XAML, I have the following style set on a ListItem. What I want is to display the contents of the ListItem in a message box when the mouse enters a list item.

        <Style.Triggers>
            <EventTrigger RoutedEvent="Mouse.MouseEnter">

            </EventTrigger>
        </Style.Triggers>

I am wondering if its possible to fire code behind when the mouse enters the listitem.

Was it helpful?

Solution

<ListBox>
    <ListBox.ItemContainerStyle>
        <Style TargetType="ListBoxItem">
            <EventSetter Event="MouseEnter" Handler="_listBoxItem_MouseEnter"/>
        </Style>
    </ListBox.ItemContainerStyle>
</ListBox>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top