Bagikan melalui


TreeViewItem.Expanded Kejadian

Definisi

Terjadi ketika IsExpanded properti berubah dari false ke true.

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

Jenis Acara

Contoh

Contoh berikut menunjukkan cara menetapkan penanganan aktivitas untuk peristiwa ke ExpandedTreeViewItem dan cara menentukan penanganan aktivitas di kode di belakang.

<TreeViewItem Header="Employee1"
              Name="Employee1Data" 
              IsExpanded="True" 
              Collapsed="OnCollapsed" 
              Expanded="OnExpanded">
  <TreeViewItem Header="Work Days" 
                Name="EmployeeWorkDays"
                IsSelected="True">
    <TreeViewItem Header="Tuesday" />
    <TreeViewItem Header="Friday"/>
  </TreeViewItem>
</TreeViewItem>
<TreeViewItem Header="Employee2" 
              Name="Employee2Data">
  <TreeViewItem Header="Work Days" 
                Name="emp2WorkDays" 
                Selected="GetSchedule"
                Unselected="SetSchedule">
    <TreeViewItem Header="Monday" />
    <TreeViewItem Header="Wednesday"/>
  </TreeViewItem>
</TreeViewItem>
private void OnExpanded(object sender, RoutedEventArgs e)
{
    //Perform actions when the TreeViewItem is expanded
}
Private Sub OnExpanded(ByVal sender As Object, ByVal e As RoutedEventArgs)
    'Perform actions when the TreeViewItem is expanded
End Sub

Keterangan

Peristiwa ini terjadi ketika diperluas TreeViewItem sehingga elemen anaknya terlihat.

Informasi Peristiwa Yang Dirutekan

Bidang pengidentifikasi ExpandedEvent
Strategi perutean Menggelegak
Delegasikan RoutedEventHandler

Berlaku untuk

Lihat juga