Selector.Unselected 附加事件

定义

当取消选择项时发生。

see AddUnselectedHandler, and RemoveUnselectedHandler
see AddUnselectedHandler, and RemoveUnselectedHandler
see AddUnselectedHandler, and RemoveUnselectedHandler

示例

以下示例演示如何将 Unselected 事件与 控件一 ListBox 起使用,以及如何创建事件处理程序。

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

注解

路由事件信息

标识符字段 UnselectedEvent
路由策略 鼓 泡
委托 RoutedEventHandler

适用于