title: Change design of another control using style
body: <p>I'm trying to call a design state for a control when my mouse is over an other control.
  Example : My mouse is hover "button A", I want the "button B" to change its design.</p>
  
  <p>So I tried to manage this in my template :</p>
  
  <pre><code>    xmlns:sys="clr-namespace:System;assembly=mscorlib"
  &lt;Style x:Key="ButtonStepperStyle" TargetType="Button"&gt;
              &lt;Setter Property="OverridesDefaultStyle" Value="True"/&gt;
              &lt;Setter Property="Button.Margin" Value="0" /&gt;
              &lt;Setter Property="Button.Padding" Value="0,-8,0,0" /&gt;
              &lt;Setter Property="FocusVisualStyle" Value="{x:Null}"/&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
  
                          &lt;Border Name="Bordure" 
                                      Height="25"
                                      BorderBrush="Transparent"
                                      BorderThickness="2"&gt;
                              &lt;!--&lt;Border.Background&gt;
                                  &lt;ImageBrush Stretch="Fill" RenderOptions.BitmapScalingMode="Fant" ImageSource="images/design/in game/bouton_back.png"/&gt;
                              &lt;/Border.Background&gt;--&gt;
                              &lt;Grid&gt;
                                  &lt;ContentPresenter Grid.Column="1" 
  
                                                                    Name="bla"
                                                        VerticalAlignment="Center"
                                                        HorizontalAlignment="Center" 
                                                        ContentSource="Content"&gt;
                                  &lt;/ContentPresenter&gt;
                              &lt;/Grid&gt;
                          &lt;/Border&gt;
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;!--&lt;Trigger Property="Tag"&gt;
                                  &lt;Trigger.Value&gt;
                                      &lt;sys:Int32&gt;1&lt;/sys:Int32&gt;
                                  &lt;/Trigger.Value&gt;
  
                                  &lt;Setter TargetName="Bordure" Property="BorderBrush" Value="{DynamicResource CouleurBoutonHover}"/&gt;
                                  &lt;Setter TargetName="bla" Property="TextBlock.Foreground" Value="{DynamicResource CouleurTexteBoutonHover}" /&gt;
                                  &lt;Setter TargetName="Bordure" Property="Background" Value="{DynamicResource CouleurBoutonHover}" /&gt;
                                  &lt;Setter Property="Cursor" Value="Hand" /&gt;
                              &lt;/Trigger&gt;--&gt;
                              &lt;DataTrigger Binding="{Binding Path=Tag, RelativeSource={RelativeSource Self}}" Value="1"&gt;
                                  &lt;Setter TargetName="Bordure" Property="BorderBrush" Value="{DynamicResource CouleurBoutonHover}"/&gt;
                                  &lt;Setter TargetName="bla" Property="TextBlock.Foreground" Value="{DynamicResource CouleurTexteBoutonHover}" /&gt;
                                  &lt;Setter TargetName="Bordure" Property="Background" Value="{DynamicResource CouleurBoutonHover}" /&gt;
                                  &lt;Setter Property="Cursor" Value="Hand" /&gt;
                              &lt;/DataTrigger&gt;
                              &lt;MultiTrigger&gt;
                                  &lt;!-- Bouton normal --&gt;
                                  &lt;MultiTrigger.Conditions&gt;
                                      &lt;Condition Property="IsMouseOver" Value="False" /&gt;
                                      &lt;Condition Property="Button.IsPressed" Value="False" /&gt;
                                      &lt;Condition Property="IsEnabled" Value="true" /&gt;
                                  &lt;/MultiTrigger.Conditions&gt;
                                  &lt;Setter TargetName="Bordure" Property="BorderBrush" Value="{DynamicResource CouleurSecondaire}"/&gt;
                                  &lt;Setter TargetName="bla" Property="TextBlock.Foreground" Value="{DynamicResource CouleurTexte}" /&gt;
                                  &lt;Setter TargetName="Bordure" Property="Background" Value="Transparent" /&gt;
                                  &lt;Setter Property="Cursor" Value="Hand" /&gt;
                              &lt;/MultiTrigger&gt;
                              &lt;MultiTrigger&gt;
                                  &lt;!-- Bouton over --&gt;
                                  &lt;MultiTrigger.Conditions&gt;
                                      &lt;Condition Property="IsMouseOver" Value="True" /&gt;
                                      &lt;Condition Property="Button.IsPressed" Value="False" /&gt;
                                      &lt;Condition Property="IsEnabled" Value="true" /&gt;
                                  &lt;/MultiTrigger.Conditions&gt;
                                  &lt;Setter TargetName="Bordure" Property="BorderBrush" Value="{DynamicResource CouleurBoutonHover}"/&gt;
                                  &lt;Setter TargetName="bla" Property="TextBlock.Foreground" Value="{DynamicResource CouleurTexteBoutonHover}" /&gt;
                                  &lt;Setter TargetName="Bordure" Property="Background" Value="{DynamicResource CouleurBoutonHover}" /&gt;
                                  &lt;Setter Property="Cursor" Value="Hand" /&gt;
                              &lt;/MultiTrigger&gt;
                              &lt;MultiTrigger&gt;
                                  &lt;!-- Bouton pressed --&gt;
                                  &lt;MultiTrigger.Conditions&gt;
                                      &lt;Condition Property="IsMouseOver" Value="True" /&gt;
                                      &lt;Condition Property="Button.IsPressed" Value="True" /&gt;
                                      &lt;Condition Property="IsEnabled" Value="true" /&gt;
                                  &lt;/MultiTrigger.Conditions&gt;
                                  &lt;Setter TargetName="Bordure" Property="BorderBrush" Value="{DynamicResource CouleurBoutonPressed}"/&gt;
                                  &lt;Setter TargetName="bla" Property="TextBlock.Foreground" Value="{DynamicResource CouleurTexteBoutonPressed}" /&gt;
                                  &lt;Setter TargetName="Bordure" Property="Background" Value="{DynamicResource CouleurBoutonPressed}" /&gt;
                                  &lt;Setter Property="Cursor" Value="Hand" /&gt;
                              &lt;/MultiTrigger&gt;
  
                              &lt;Trigger Property="IsEnabled" Value="False"&gt;
                                  &lt;Setter TargetName="Bordure" Property="BorderBrush" Value="{DynamicResource CouleurBoutonDisabled}"/&gt;
                                  &lt;Setter TargetName="bla" Property="TextBlock.Foreground" Value="{DynamicResource CouleurTexteBoutonDisabled}" /&gt;
                                  &lt;Setter TargetName="Bordure" Property="Background" Value="Transparent" /&gt;
                                  &lt;Setter Property="Cursor" Value="Arrow" /&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>This is the style for my button, I handled the event Mouse Enter and mouse Leave and put "button B"'s Tag to 1 on "Button A"'s Mouse enter and to 0 on "Button A"'s MouseLeave.</p>
  
  <p>My reflexion was to say if Tag=1 then change the background and the foreground. I've tried several options with a trigger and a datatrigger buth none of them seem to work.</p>
  
  <p>How can I fix this ?</p>
  
  <p>Thank you !</p>