Selector.Selected Selector.Selected Selector.Selected Attached Event

정의

항목이 선택될 때 발생합니다.Occurs when an item is selected.

see AddSelectedHandler, and RemoveSelectedHandler
see AddSelectedHandler, and RemoveSelectedHandler
see AddSelectedHandler, and RemoveSelectedHandler

예제

다음 예제에 사용 하는 방법을 보여 줍니다 합니다 Selected 이벤트를 ListBox 제어 합니다.The following examples show how to use the Selected event with a ListBox control. 첫 번째 예제에서는 이벤트를 발생 하 고 두 번째 이벤트를 처리 하는 방법을 보여 줍니다.The first example raises the event and the second shows how to handle the event.

<ListBoxItem Name="lbi0" Selected="OnSelected" Unselected="OnUnselected">
     Item 0</ListBoxItem>
private void OnSelected(object sender, RoutedEventArgs e)
{
    Item.Content = ((ListBoxItem)sender).Name + " was selected.";
}
Private Sub OnSelected(ByVal sender As Object, ByVal e As RoutedEventArgs)
	Item.Content = (CType(sender, ListBoxItem)).Name & " was selected."
End Sub

설명

라우팅 이벤트 정보Routed Event Information

식별자 필드Identifier field SelectedEvent
라우팅 전략Routing strategy 버블링Bubbling
대리자Delegate RoutedEventHandler

적용 대상