Occurs when a ListBoxItem is selected.
public event RoutedEventHandler Selected
<object Selected="RoutedEventHandler" .../>
To know when the selection in a ListBox changes, listen for the SelectionChanged event.
The following example shows how to subscribe to and handle this event.
<ListBoxItem Name="lbi0" Selected="OnSelected" Unselected="OnUnselected">Item 0</ListBoxItem>
private void OnSelected(object sender, RoutedEventArgs e)
ListBoxItem lbi = e.Source as ListBoxItem;
if (lbi != null)
label1.Content = lbi.Content.ToString() + " is selected.";