Popup.Opened 事件

定义

IsOpen 属性更改为 true 时发生。Occurs when the IsOpen property changes to true.

public:
 event EventHandler ^ Opened;
public event EventHandler Opened;
member this.Opened : EventHandler 
Public Custom Event Opened As EventHandler 

示例

下面的示例演示如何为Opened事件定义事件处理程序。The following example shows how to define an event handler for the Opened event.

private void PopupOpening(object sender, EventArgs e)
{
    //Code to execute when Popup opens
}
Private Sub PopupOpening(ByVal sender As Object, ByVal e As EventArgs)
    'Code to execute when Popup opens
End Sub
<DockPanel>
  <Popup Opened="PopupOpening">
    <TextBlock Background="Yellow">Popup Text</TextBlock>
  </Popup>
</DockPanel>

注解

Popup 通过IsOpen切换属性打开并关闭。A Popup is opened and closed by toggling the IsOpen property.

适用于

另请参阅