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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.