ContextMenu.Opened Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Event Type
Examples
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
Remarks
Routed Event Information
Identifier field | OpenedEvent |
Routing strategy | Bubbling |
Delegate | RoutedEventHandler |
Applies to
See also
Samarbeta med oss på GitHub
Källan för det här innehållet finns på GitHub, där du även kan skapa och granska ärenden och pull-begäranden. Se vår deltagarguide för mer information.