ContextMenu.Opened Ereignis

Definition

Tritt auf, wenn eine bestimmte Instanz eines Kontextmenüs geöffnet wird.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 

Beispiele

Im folgenden Beispiel wird gezeigt, wie die ContextMenu Ereignisse verwendet werden: Opened und 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

Hinweise

Informationen zum RoutingereignisRouted Event Information

BezeichnerfeldIdentifier field OpenedEvent
Routing StrategieRouting strategy BlasenBubbling
DelegatDelegate RoutedEventHandler

Gilt für:

Siehe auch