title: TreeView selection problem in Silverlight 3
body: <p>I have a TreeView control from System.Windows.Controls on MainPage.</p>
  
  <pre><code>&lt;controls:TreeView x:Name="Tree" 
    SelectedItemChanged="Tree_SelectedItemChanged" /&gt;
  </code></pre>
  
  <p>MainPage ctor looks like this:</p>
  
  <pre><code>  public MainPage()
          {
              InitializeComponent();
  
              for (int i = 0; i &lt; 10; ++i)
                 Tree.Items.Add(new TreeViewItem() { Header = i.ToString() } );
  
              (Tree.Items[0] as TreeViewItem).IsSelected = true;
          }
  </code></pre>
  
  <p>Just fill TreeView and select first element.</p>
  
  <p>In Tree_SelectedItemChanged I want to do some action with selection item, but Tree.SelectedItem has a null value.</p>
  
  <p>I don't understand why it happens. TreeView in Wpf works fine.</p>
  
  <p>Have you any ideas about it?</p>