ContextMenu.Opened Evento

Definição

Ocorre quando uma instância específica de um menu contextual se abre.

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

Tipo de Evento

Exemplos

O exemplo seguinte mostra como usar os ContextMenu eventos: Opened e 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

Observações

Informação sobre Eventos Roteados

Iteme Value
Campo identificador OpenedEvent
Estratégia de encaminhamento Borbulhar
Delegar RoutedEventHandler

Aplica-se a

Ver também