title: Set Value of Setter to Attached Property
body: <p>I need to be able to set the Value of a setter to an attached property, but am having difficulty coming up with the syntax. This is what my trigger looks like:</p>
  
  <pre><code>&lt;DataTrigger Binding="{Binding Path=IsDisabled}" Value="True"&gt;
      &lt;Setter TargetName="LayoutRoot" Property="Opacity" Value="0.3" /&gt;
      &lt;Setter TargetName="LayoutRoot" Property="Background" Value="Interaction:Behaviors.OriginalBgBrush" /&gt;
  &lt;/DataTrigger&gt;
  </code></pre>
  
  <p>where Interaction:Behaviors.OriginalBgBrush is the attached property set on LayoutRoot, and LayoutRoot is a Border. I'm having to do this because a standard Trigger above this one sets the Background, but there's no way for me to check values of a template and data trigger at the same time. Below is the entire template with the MultiTrigger being the one that sets the background where I don't want it to. Also the background color is defined in a separate style that uses this ControlTemplate as its' Template property.</p>
  
  <pre><code>&lt;ControlTemplate x:Key="StandardRowStyle" TargetType="tk:DataGridRow"&gt;
      &lt;Border x:Name="LayoutRoot" Margin="0,0,0,-1" MinHeight="23" Interaction:Behaviors.OriginalBgBrush="{TemplateBinding Background}" PreviewMouseRightButtonDown="DataGridRow_SimpleMouseDown" PreviewMouseLeftButtonDown="DataGridRow_SimpleMouseDown" Background="{TemplateBinding Background}" BorderBrush="{StaticResource ElementBorderBrush}" BorderThickness="1" CornerRadius="0" SnapsToDevicePixels="True"&gt;
          &lt;toolkit:SelectiveScrollingGrid x:Name="DGR_SelectiveScrollingGrid"&gt;
              &lt;toolkit:SelectiveScrollingGrid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="Auto"/&gt;
                  &lt;ColumnDefinition Width="*"/&gt;
              &lt;/toolkit:SelectiveScrollingGrid.ColumnDefinitions&gt;
  
              &lt;toolkit:SelectiveScrollingGrid.RowDefinitions&gt;
                  &lt;RowDefinition Height="*" MinHeight="23"/&gt;
                  &lt;RowDefinition Height="Auto"/&gt;
              &lt;/toolkit:SelectiveScrollingGrid.RowDefinitions&gt;
  
              &lt;toolkit:DataGridCellsPresenter Grid.Column="1" Grid.Row="0" x:Name="DGR_CellsPresenter" ItemsPanel="{TemplateBinding ItemsPanel}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/&gt;
              &lt;toolkit:DataGridDetailsPresenter Grid.Column="1" Grid.Row="1" Visibility="{TemplateBinding DetailsVisibility}" toolkit:SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding Path=AreRowDetailsFrozen, Converter={x:Static tk:DataGrid.RowDetailsScrollingConverter}, ConverterParameter={x:Static tk:SelectiveScrollingOrientation.Vertical}, RelativeSource={RelativeSource AncestorType={x:Type tk:DataGrid}}}" /&gt;
              &lt;!--&lt;toolkit:DataGridRowHeader Grid.Column="2" Grid.RowSpan="2" toolkit:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical" Visibility="{Binding Path=HeadersVisibility, Converter={x:Static tk:DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static tk:DataGridHeadersVisibility.Row}, RelativeSource={RelativeSource AncestorType={x:Type tk:DataGrid}}}"/&gt;--&gt;
          &lt;/toolkit:SelectiveScrollingGrid&gt;
      &lt;/Border&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;Condition Property="DetailsVisibility" Value="Collapsed" /&gt;     
              &lt;/MultiTrigger.Conditions&gt;
              &lt;Setter TargetName="LayoutRoot" Property="Background" Value="{StaticResource InactiveSelectedBackgroundBrush}" /&gt;
              &lt;Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{StaticResource InactiveOuterBorderBrush}" /&gt;
              &lt;Setter TargetName="LayoutRoot" Property="CornerRadius" Value="5" /&gt;
          &lt;/MultiTrigger&gt;            
          &lt;DataTrigger Binding="{Binding Path=IsDisabled}" Value="True"&gt;
              &lt;Setter TargetName="LayoutRoot" Property="Opacity" Value="0.3" /&gt;
              &lt;!-- Background needs to be changed back to default here --&gt;
          &lt;/DataTrigger&gt;
      &lt;/ControlTemplate.Triggers&gt;
  &lt;/ControlTemplate&gt;
  </code></pre>