ContextMenu.Opened Événement

Définition

Se produit lors de l’ouverture d’une instance particulière d’un menu contextuel.

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

Type d'événement

Exemples

L’exemple suivant montre comment utiliser les ContextMenu événements : Opened et 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

Remarques

Informations sur les événements acheminés

Champ Identificateur OpenedEvent
Stratégie de routage Bouillonnant
Délégué RoutedEventHandler

S’applique à

Voir aussi