title: MultiTrigger Condition to same binding/ Switch controls using Trigger
body: <p>I am trying to have <code>p:MarqueeTextBlock</code> to only scroll on <code>ListBox</code> <code>IsSelected</code> under <code>TargetType="{x:Type ListBoxItem}"</code>.</p>
  
  <p>Having trouble to work out adding a <code>MultiTrigger</code> conditions (fired when <code>IsSelected</code> becomes <code>True</code> or <code>False</code>) to change the <code>Property="Scroll"</code> of the <code>p:MarqueeTextBlock</code> to <code>Off</code> or <code>LeftTypewriter</code>. In addition not sure how to reference the <code>p:MarqueeTextBlock</code> in the <code>DataTemplate</code>; perhaps if I provide it an <code>x:Name</code>? However I get <code>Template property has already been set on DataTemplate</code>.</p>
  
  <p>I need to add <code>AOTbMain_MARQUEE</code> somehow in <code>x:Key="ListBoxStyle_GAME"</code> like:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;p:MarqueeTextBlock Text="{Binding Path=Title}" Style="{StaticResource AOTbMain_MARQUEE}"/&gt;
  </code></pre>
  
  <p>Code with above reference not added:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;UserControl
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:p="clr-namespace:Plugin.Controls;assembly=Plugin.v1"
      mc:Ignorable="d"
      d:DesignHeight="2160" d:DesignWidth="3840"&gt;
  
      &lt;UserControl.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;Style x:Key="ListBoxItemStyle" TargetType="ListBoxItem"&gt;
                  &lt;Setter Property="Template"&gt;
                      &lt;Setter.Value&gt;
                          &lt;ControlTemplate TargetType="{x:Type ListBoxItem}"&gt;
                              &lt;Grid&gt;
                                  &lt;Image x:Name="SelectedGameOverlay" Source="{}pack://siteoforigin:,,,/Images/Selected Game Overlay.png" RenderOptions.BitmapScalingMode="HighQuality" Visibility="Hidden" /&gt;
                                  &lt;ContentPresenter x:Name="SelectedGameTextColour" HorizontalAlignment="Left" /&gt;
                              &lt;/Grid&gt;
                              &lt;ControlTemplate.Triggers&gt;
                                  &lt;MultiTrigger&gt;
                                      &lt;MultiTrigger.Conditions&gt;
                                          &lt;Condition Property="Selector.IsSelectionActive" Value="False" /&gt;
                                          &lt;Condition Property="IsSelected" Value="True" /&gt;
                                      &lt;/MultiTrigger.Conditions&gt;
                                      &lt;Setter Property="Opacity" Value="1" /&gt;
                                      &lt;Setter TargetName="SelectedGameOverlay" Property="Visibility" Value="Visible" /&gt;
                                      &lt;Setter TargetName="SelectedGameTextColour" Property="TextElement.Foreground" Value="#FFFFFF" /&gt;
                                  &lt;/MultiTrigger&gt;
                                  &lt;MultiTrigger&gt;
                                      &lt;MultiTrigger.Conditions&gt;
                                          &lt;Condition Property="Selector.IsSelectionActive" Value="True" /&gt;
                                          &lt;Condition Property="IsSelected" Value="True" /&gt;
                                      &lt;/MultiTrigger.Conditions&gt;
                                      &lt;Setter Property="Opacity" Value="1" /&gt;
                                      &lt;Setter TargetName="SelectedGameOverlay" Property="Visibility" Value="Visible" /&gt;
                                      &lt;Setter TargetName="SelectedGameTextColour" Property="TextElement.Foreground" Value="#FFFFFF" /&gt;
                                  &lt;/MultiTrigger&gt;
                              &lt;/ControlTemplate.Triggers&gt;
                          &lt;/ControlTemplate&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Style&gt;
  
              &lt;Style x:Key="ListBoxStyle" TargetType="p:AutoscrollListBox"&gt;
                  &lt;Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemStyle}" /&gt;
                  &lt;Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" /&gt;
                  &lt;Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" /&gt;
                  &lt;Setter Property="Background" Value="Transparent" /&gt;
                  &lt;Setter Property="BorderThickness" Value="0" /&gt;
              &lt;/Style&gt;
  
              &lt;Style x:Key="ListBoxStyle_BASE" TargetType="p:AutoscrollListBox" BasedOn="{StaticResource ListBoxStyle}"&gt;
                  &lt;Setter Property="ScrollMode" Value="Center" /&gt;
                  &lt;Setter Property="ItemContainerStyle"&gt;
                      &lt;Setter.Value&gt;
                          &lt;Style TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItemStyle}"&gt;
                              &lt;Setter Property="Padding" Value="1" /&gt;
                          &lt;/Style&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Style&gt;
  
              &lt;Style x:Key="AOTbMain_MARQUEE" TargetType="p:MarqueeTextBlock"&gt;
                  &lt;Setter Property="Scroll" Value="LeftTypewriter" /&gt;
                  &lt;Setter Property="ScrollDelayBeg" Value="0:0:5" /&gt;
                  &lt;Setter Property="ScrollDelayEnd" Value="0:0:3" /&gt;
                  &lt;Setter Property="ScrollSpeed" Value="0:0:5" /&gt;
              &lt;/Style&gt;
  
              &lt;Style x:Key="ListBoxStyle_BASE_INDXFADER" TargetType="p:AutoscrollListBox" BasedOn="{StaticResource ListBoxStyle_BASE}"&gt;
                  &lt;Style.Triggers&gt;
                      &lt;DataTrigger Binding="{Binding IndexVisibility}" Value="Visible"&gt;
                          &lt;Setter Property="Opacity" Value="0.1" /&gt;
                      &lt;/DataTrigger&gt;
                      &lt;DataTrigger Binding="{Binding IndexVisibility}" Value="Hidden"&gt;
                          &lt;Setter Property="Opacity" Value="1" /&gt;
                      &lt;/DataTrigger&gt;
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;
  
              &lt;Style x:Key="ListBoxStyle_BASETB" TargetType="p:AutoscaleTextBlock"&gt;
                  &lt;Setter Property="TextTrimming" Value="CharacterEllipsis" /&gt;
                  &lt;Setter Property="TargetFontSize" Value="30" /&gt;
              &lt;/Style&gt;
  
              &lt;Style x:Key="ListBoxStyle_GAME" TargetType="p:AutoscrollListBox" BasedOn="{StaticResource ListBoxStyle_BASE_INDXFADER}"&gt;
                  &lt;Setter Property="ItemTemplate"&gt;
                      &lt;Setter.Value&gt;
                          &lt;DataTemplate&gt;
                              &lt;p:AutoscaleTextBlock Text="{Binding Path=Title}" Style="{StaticResource ListBoxStyle_BASETB}" /&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Style&gt;
  
              &lt;Style x:Key="ListBoxItemStyleSearch" TargetType="ListBoxItem"&gt;
                  &lt;Setter Property="Template"&gt;
                      &lt;Setter.Value&gt;
                          &lt;ControlTemplate TargetType="{x:Type ListBoxItem}"&gt;
                              &lt;Grid&gt;
                                  &lt;ContentPresenter x:Name="SelectedSearchTextColour" /&gt;
                              &lt;/Grid&gt;
                              &lt;ControlTemplate.Triggers&gt;
                                  &lt;Trigger Property="IsSelected" Value="True" /&gt;
                                      &lt;Setter Property="Opacity" Value="1" /&gt;
                                      &lt;Setter TargetName="SelectedSearchTextColour" Property="TextElement.Foreground" Value="#FFFFFF" /&gt;
                                  &lt;/Trigger&gt;
                              &lt;/ControlTemplate.Triggers&gt;
                          &lt;/ControlTemplate&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Style&gt;
  
              &lt;Style x:Key="ListBoxStyleSearch" TargetType="p:AutoscrollListBox"&gt;
                  &lt;Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemStyleSearch}" /&gt;
                  &lt;Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" /&gt;
                  &lt;Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" /&gt;
                  &lt;Setter Property="BorderBrush" Value="Transparent" /&gt;
                  &lt;Setter Property="Background" Value="Transparent" /&gt;
              &lt;/Style&gt;
  
              &lt;Style x:Key="ListBoxStyle_INDX" TargetType="p:AutoscrollListBox" BasedOn="{StaticResource ListBoxStyleSearch}"&gt;
                  &lt;Setter Property="ItemContainerStyle"&gt;
                      &lt;Setter.Value&gt;
                          &lt;Style TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItemStyleSearch}"&gt;
                              &lt;Setter Property="Padding" Value="1" /&gt;
                          &lt;/Style&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;
              &lt;/Style&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/UserControl.Resources&gt;
  
      &lt;Grid&gt;
          &lt;Viewbox HorizontalAlignment="Left"&gt;
              &lt;p:AutoscrollListBox Name="Index" Style="{StaticResource ListBoxStyle_INDX}" Visibility="{Binding IndexVisibility}" /&gt;
          &lt;/Viewbox&gt;
  
          &lt;p:AutoscrollListBox Name="Items" Style="{StaticResource ListBoxStyle_GAME}" /&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>