title: Problem with control template on listbox item
body: <p>I have own style on listbox item, here is it:</p>
  
  <pre><code>        &lt;Style x:Key="friendsListStyle" TargetType="{x:Type ListBox}"&gt;
              &lt;Setter Property="ItemTemplate"&gt;
                  &lt;Setter.Value&gt;
                      &lt;DataTemplate&gt;
                          &lt;Grid Name="RootLayout"&gt;
                              &lt;Grid.ColumnDefinitions&gt;
                                  &lt;ColumnDefinition Width="0.3*"&gt;&lt;/ColumnDefinition&gt;
                                  &lt;ColumnDefinition Width="*"&gt;&lt;/ColumnDefinition&gt;
                              &lt;/Grid.ColumnDefinitions&gt;
                              &lt;Grid.RowDefinitions&gt;
                                  &lt;RowDefinition Height="60"&gt;&lt;/RowDefinition&gt;
                              &lt;/Grid.RowDefinitions&gt;
                              &lt;Image Margin="4,4,4,2" Grid.Column="0"&gt;
                                  &lt;Image.Source &gt;
                                      &lt;MultiBinding Converter="{StaticResource avatarConverter}"&gt;
                                          &lt;Binding Path="ProfilePhoto"&gt;&lt;/Binding&gt;
                                          &lt;Binding Path="StatusInfo.IsLogged"&gt;&lt;/Binding&gt;
                                      &lt;/MultiBinding&gt;
                                  &lt;/Image.Source&gt;
                              &lt;/Image&gt;
                              &lt;Grid  Grid.Column="1"&gt;
                                      &lt;Grid.ColumnDefinitions&gt;
                                          &lt;ColumnDefinition Width="*"&gt;&lt;/ColumnDefinition&gt;
                                      &lt;/Grid.ColumnDefinitions&gt;
                                      &lt;Grid.RowDefinitions&gt;
                                          &lt;RowDefinition Height="*"&gt;&lt;/RowDefinition&gt;
                                          &lt;RowDefinition Height="*"&gt;&lt;/RowDefinition&gt;
                                          &lt;RowDefinition Height="*"&gt;&lt;/RowDefinition&gt;
                                      &lt;/Grid.RowDefinitions&gt;
                                      &lt;TextBlock 
                                         Text="{Binding Path=Nick}" 
                                         Margin="2,2,2,2" 
                                         FontSize="13" 
                                         FontWeight="Medium"
                                         Grid.Column="0" Grid.Row="0"&gt;
                                      &lt;/TextBlock&gt;
                                      &lt;TextBlock  
                                         Text="{Binding Path=StatusMessageInfo.Message}"
                                         FontSize="11" 
                                         FontWeight="Normal" 
                                         Foreground="DarkGray"
                                         Grid.Column="0" Grid.Row="1" Margin="2,2,2,2"&gt;&lt;/TextBlock&gt;
                                      &lt;TextBlock  
                                         Style="{StaticResource StatusStyle}"
                                         Grid.Column="0" Grid.Row="2" &gt;
                                      &lt;TextBlock.Text&gt;
                                      &lt;MultiBinding Converter="{StaticResource infoConverter}"&gt;
                                          &lt;Binding Path="StatusInfo.IsLogged"&gt;&lt;/Binding&gt;
                                          &lt;Binding Path="StatusInfo.IsChating"&gt;&lt;/Binding&gt;
                                          &lt;Binding Path="StatusInfo.RoomName"&gt;&lt;/Binding&gt;
                                      &lt;/MultiBinding&gt;
                                      &lt;/TextBlock.Text&gt;
                                      &lt;/TextBlock&gt;
                                  &lt;/Grid&gt;
                          &lt;/Grid&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>In app look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/1r5jE.jpg" alt="alt text"></p>
  
  <p>I need change color of listbox item when is selected, so I try wrote control template on listbox item and use in listbox style:</p>
  
  <p>Here is control template on listbox item:</p>
  
  <pre><code>        &lt;Style x:Key="FriendListBoxItemStyle" TargetType="ListBoxItem"&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type ListBoxItem}"&gt;
                          &lt;Grid Name="RootLayout"&gt;
                              &lt;Grid.ColumnDefinitions&gt;
                                  &lt;ColumnDefinition Width="0.3*"&gt;&lt;/ColumnDefinition&gt;
                                  &lt;ColumnDefinition Width="*"&gt;&lt;/ColumnDefinition&gt;
                              &lt;/Grid.ColumnDefinitions&gt;
                              &lt;Grid.RowDefinitions&gt;
                                  &lt;RowDefinition Height="60"&gt;&lt;/RowDefinition&gt;
                              &lt;/Grid.RowDefinitions&gt;
                              &lt;Image Margin="4,4,4,2" Grid.Column="0"&gt;
                                  &lt;Image.Source &gt;
                                      &lt;MultiBinding Converter="{StaticResource avatarConverter}"&gt;
                                          &lt;Binding Path="ProfilePhoto"&gt;&lt;/Binding&gt;
                                          &lt;Binding Path="StatusInfo.IsLogged"&gt;&lt;/Binding&gt;
                                      &lt;/MultiBinding&gt;
                                  &lt;/Image.Source&gt;
                              &lt;/Image&gt;
                              &lt;Grid  Grid.Column="1"&gt;
                                  &lt;Grid.ColumnDefinitions&gt;
                                      &lt;ColumnDefinition Width="*"&gt;&lt;/ColumnDefinition&gt;
                                  &lt;/Grid.ColumnDefinitions&gt;
                                  &lt;Grid.RowDefinitions&gt;
                                      &lt;RowDefinition Height="*"&gt;&lt;/RowDefinition&gt;
                                      &lt;RowDefinition Height="*"&gt;&lt;/RowDefinition&gt;
                                      &lt;RowDefinition Height="*"&gt;&lt;/RowDefinition&gt;
                                  &lt;/Grid.RowDefinitions&gt;
                                  &lt;TextBlock 
                                         Text="{Binding Path=Nick}" 
                                         Margin="2,2,2,2" 
                                         FontSize="13" 
                                         FontWeight="Medium"
                                         Grid.Column="0" Grid.Row="0"&gt;
                                  &lt;/TextBlock&gt;
                                  &lt;TextBlock  
                                         Text="{Binding Path=StatusMessageInfo.Message}"
                                         FontSize="11" 
                                         FontWeight="Normal" 
                                         Foreground="DarkGray"
                                         Grid.Column="0" Grid.Row="1" Margin="2,2,2,2"&gt;&lt;/TextBlock&gt;
                                  &lt;TextBlock  
                                         Style="{StaticResource StatusStyle}"
                                         Grid.Column="0" Grid.Row="2" &gt;
                                      &lt;TextBlock.Text&gt;
                                      &lt;MultiBinding Converter="{StaticResource infoConverter}"&gt;
                                          &lt;Binding Path="StatusInfo.IsLogged"&gt;&lt;/Binding&gt;
                                          &lt;Binding Path="StatusInfo.IsChating"&gt;&lt;/Binding&gt;
                                          &lt;Binding Path="StatusInfo.RoomName"&gt;&lt;/Binding&gt;
                                      &lt;/MultiBinding&gt;
                                      &lt;/TextBlock.Text&gt;
                                  &lt;/TextBlock&gt;
                              &lt;/Grid&gt;
                          &lt;/Grid&gt;                           
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;MultiTrigger&gt;
                                  &lt;MultiTrigger.Conditions&gt;
                                      &lt;Condition Property="IsMouseOver" Value="True" /&gt;
                                      &lt;Condition Property="IsSelected" Value="False"/&gt;
                                  &lt;/MultiTrigger.Conditions&gt;
                                  &lt;Setter Property="Background" Value="Yellow" /&gt;
                              &lt;/MultiTrigger&gt;
                              &lt;Trigger Property="IsSelected" Value="True"&gt;
                                  &lt;Setter Property="Background" Value="Red" /&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>Apply on listBox style:</p>
  
  <pre><code>        &lt;Style x:Key="FriendListBoxStyle" TargetType="{x:Type ListBox}"&gt;
              &lt;Setter Property="ItemContainerStyle" Value="{DynamicResource FriendListBoxItemStyle}" /&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>An finally apply listbox style on control in view:</p>
  
  <pre><code>    &lt;ListBox Name="Friends" 
               SelectedIndex="{Binding Path=SelectedFriendsIndex,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
               SelectedItem="{Binding Path=SelectedFriend, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}"
               Style="{StaticResource FriendListBoxStyle}"/&gt;
  </code></pre>
  
  <p>I run app and listbox look as here:</p>
  
  <p><img src="https://i.stack.imgur.com/VkG5D.jpg" alt="alt text"></p>
  
  <p>Also items in listbox are not selectable, so I can’t select item in listbox. What is bad?</p>