title: How to change StackPanel color using ComboBox SelectionChanged event?
body: <p>Following xaml code is okey.</p>
  
  <pre><code>&lt;Window x:Class="MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="MainWindow" Height="350" Width="525"&gt;
  &lt;Window.Resources&gt;
      &lt;ObjectDataProvider ObjectInstance="{x:Type Colors}" MethodName="GetProperties" x:Key="colorPropertiesOdp" /&gt;
  &lt;/Window.Resources&gt;
  &lt;Grid&gt;
      &lt;StackPanel Name="StackPanel1" Width="200" Height="30" Background="Red" VerticalAlignment="Top"/&gt;
      &lt;ComboBox Name="ComboBox1" Width="200" Height="30" ItemsSource="{Binding Source={StaticResource colorPropertiesOdp}}" SelectedValuePath="Name"&gt;
          &lt;ComboBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;StackPanel Orientation="Horizontal" Height="18" Margin="0,0,0,2"&gt;
                      &lt;Border x:Name="Border1" BorderThickness="1" CornerRadius="2" BorderBrush="Black" Width="50" VerticalAlignment="Stretch" Background="{Binding Name}"/&gt;
                      &lt;TextBlock Text="{Binding Name}" Margin="8,0,0,0"/&gt;
                  &lt;/StackPanel&gt;
              &lt;/DataTemplate&gt;
          &lt;/ComboBox.ItemTemplate&gt;
      &lt;/ComboBox&gt;
  &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>Following vb.net code is not okey and need to be repaired.</p>
  
  <pre><code>Private Sub ComboBox1_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles ComboBox1.SelectionChanged
      StackPanel1.Background = Border1.Background
  End Sub
  </code></pre>
  
  <p>Following C# code is not okey and need to be repaired.</p>
  
  <pre><code>private void ComboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e) {
      StackPanel1.Background = Border1.Background;
  }
  </code></pre>
  
  <p>Thanks in advance</p>