ContextMenu.Closed 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在 ContextMenu 的特定实例关闭时发生。
public:
event System::Windows::RoutedEventHandler ^ Closed;
public event System.Windows.RoutedEventHandler Closed;
member this.Closed : System.Windows.RoutedEventHandler
Public Custom Event Closed As RoutedEventHandler
事件类型
示例
以下示例演示如何使用 ContextMenu 事件: Opened 和 Closed。
<ContextMenu Name="cm" Opened="OnOpened" Closed="OnClosed" StaysOpen="true">
void OnOpened(object sender, RoutedEventArgs e)
{
cmButton.Content = "The ContextMenu Opened";
}
void OnClosed(object sender, RoutedEventArgs e)
{
cmButton.Content = "The ContextMenu Closed";
}
Private Sub OnOpened(ByVal sender As Object, ByVal args As RoutedEventArgs)
cmButton.Content = "The ContextMenu Opened"
End Sub
Private Sub OnClosed(ByVal sender As Object, ByVal args As RoutedEventArgs)
cmButton.Content = "The ContextMenu Closed"
End Sub
注解
路由事件信息
标识符字段 | ClosedEvent |
路由策略 | 鼓 泡 |
委托 | RoutedEventHandler |