Expander.Expanded 事件

定义

Expander 控件的内容窗口打开时发生,以便同时显示其标题和内容。

public:
 event System::Windows::RoutedEventHandler ^ Expanded;
public event System.Windows.RoutedEventHandler Expanded;
member this.Expanded : System.Windows.RoutedEventHandler 
Public Custom Event Expanded As RoutedEventHandler 

事件类型

示例

以下示例演示如何指定 Expanded 事件的事件处理程序。

yourExpander.Expanded += new RoutedEventHandler(expanderHasExpanded);
AddHandler yourExpander.Expanded, AddressOf expanderHasExpanded
<Expander Name ="yourExpander" Expanded="expanderHasExpanded" 
          Header ="expanderTitle" Content="expanderContent"/>

以下示例演示如何定义 事件处理程序。

private void expanderHasExpanded(object sender, RoutedEventArgs args)
{
    //Do something when the Expander control expands
}
Private Sub expanderHasExpanded(ByVal sender As Object, ByVal args As RoutedEventArgs)
    'Do something when the Expander control expands
End Sub

注解

Expanded 属性从 falsetrue更改为 时IsExpanded发生该事件。

路由事件信息

标识符字段 ExpandedEvent
路由策略 鼓 泡
委托 RoutedEventHandler

适用于

另请参阅