title: Why is VisualTreeHelper.GetChildrenCount(lbi) == 0?
body: <p>I am trying to get my ToggleButton from a DataTemplate</p>
  
  <pre><code>ListBoxItem lbi = this.UnitsListBox.ItemContainerGenerator.ContainerFromItem(obj) as ListBoxItem;
  </code></pre>
  
  <p>lbi is ok (not null). </p>
  
  <p>I would like to do this: </p>
  
  <pre><code>ContentPresenter cp = VisualTreeHelper.GetChild(lbi, 0) as ContentPresenter;
  ToggleButton btn = (ToggleButton) VisualTreeHelper.GetChild(cp, 0);
  </code></pre>
  
  <p>But </p>
  
  <pre><code>VisualTreeHelper.GetChildrenCount(lbi) is 0. 
  </code></pre>
  
  <p>This is my XAML</p>
  
  <pre><code>&lt;ListBox  MaxWidth="215" FlowDirection="RightToLeft" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto"   DockPanel.Dock="Left" Name="UnitsListBox" VirtualizingStackPanel.IsVirtualizing="False" SelectionChanged="UnitsListBox_SelectionChanged" IsSynchronizedWithCurrentItem="True"&gt;
                  &lt;ListBox.ItemsPanel&gt;
                      &lt;ItemsPanelTemplate&gt;
                          &lt;WrapPanel /&gt;
                      &lt;/ItemsPanelTemplate&gt;
                  &lt;/ListBox.ItemsPanel&gt;
                  &lt;ListBox.Resources&gt;
                      &lt;Style TargetType="Button"/&gt;
                  &lt;/ListBox.Resources&gt;
                  &lt;ListBox.ItemTemplate  &gt;
                      &lt;DataTemplate &gt;
                          &lt;ToggleButton x:Name="UnitSidebarButton"  FlowDirection="LeftToRight" Height="60" Width="60"  HorizontalContentAlignment="Center" Background="Transparent"  Margin="0" Padding="0" Checked="UnitSidebarButton_Checked" Unchecked="UnitSidebarButton_Unchecked" Focusable="False" VirtualizingStackPanel.IsVirtualizing="False"&gt;
                              &lt;Grid&gt;
                                  &lt;Grid.ColumnDefinitions&gt;
                                      &lt;ColumnDefinition Width="*"/&gt;
                                  &lt;/Grid.ColumnDefinitions&gt;
                                  &lt;Grid.RowDefinitions&gt;
                                      &lt;RowDefinition Height="*"/&gt;
                                  &lt;/Grid.RowDefinitions&gt;
                                  &lt;TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Converter={StaticResource cIMSidebarConverter2}}" TextWrapping="Wrap"  TextAlignment="Center" Background="Transparent"/&gt;
                            &lt;/Grid&gt;
                          &lt;/ToggleButton&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/ListBox.ItemTemplate&gt;
              &lt;/ListBox&gt;
  </code></pre>