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
Співпраця з нами на GitHub
Джерело цього вмісту можна знайти на GitHub, де також можна створювати й переглядати запитання та запити на внесення змін. Докладні відомості наведено в нашому посібнику для співавторів.