ContextMenu.Opened ContextMenu.Opened ContextMenu.Opened ContextMenu.Opened Event

Definición

Se produce cuando se abre una instancia particular de un menú contextual.Occurs when a particular instance of a context menu opens.

public:
 event System::Windows::RoutedEventHandler ^ Opened;
public event System.Windows.RoutedEventHandler Opened;
member this.Opened : System.Windows.RoutedEventHandler 
Public Custom Event Opened As RoutedEventHandler 

Ejemplos

El ejemplo siguiente se muestra cómo utilizar el ContextMenu eventos: Opened y Closed.The following example shows how use the ContextMenu events: Opened and 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

Comentarios

Información sobre eventos enrutadosRouted Event Information

Campo de identificadorIdentifier field OpenedEvent
Estrategia de enrutamientoRouting strategy PropagaciónBubbling
delegadoDelegate RoutedEventHandler

Se aplica a

Consulte también: