Selector.Selected Attached Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when an item is selected.
see AddSelectedHandler, and RemoveSelectedHandler
see AddSelectedHandler, and RemoveSelectedHandler
see AddSelectedHandler, and RemoveSelectedHandler
Examples
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
Remarks
Routed Event Information
Identifier field | SelectedEvent |
Routing strategy | Bubbling |
Delegate | RoutedEventHandler |
Applies to
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.