Q:

DataTrigger setter doesn't fire up

I have a two radioButtons and two textboxs
<RadioButton x:Name="AdmLnkRadio1" GroupName="AdmLnkgr1" Content="Link #1"/>
<RadioButton x:Name="AdmLnkRadio2" GroupName="AdmLnkgr1" Content="Link #2"/>

<TextBox x:Name="AdmLnkTextBoxName1" />                                     
<TextBox x:Name="AdmLnkTextBoxName2" IsEnabled="False" >
  <TextBox.Style>
    <Style BasedOn="{StaticResource TextBoxBase}" TargetType="TextBox" >
        <Style.Triggers>  

            <!--Trigger 1  -->                                                        
            <DataTrigger Binding="{Binding ElementName=AdmLnkRadio1, Path=IsChecked}" Value="True">
                  <Setter Property="Text" Value="{Binding ElementName=AdmLnkTextBoxName1, Path=Text}"></Setter>
                  <Setter Property="IsEnabled" Value="False"></Setter>
            </DataTrigger>

             <!--Trigger 2 - Doesn't Fires UP!!!! -->  
            <DataTrigger Binding="{Binding ElementName=AdmLnkRadio2, Path=IsChecked}" Value="True">
                  <Setter Property="Text" Value=""></Setter>
                  <Setter Property="IsEnabled" Value="True"></Setter>
            </DataTrigger>

        </Style.Triggers>                                                            
     </Style>
   </TextBox.Style>
</TextBox>

When user checks radiobutton 1 the trigger 1 works and second textbox text binds to the text of the first one. But when the second radiobutton is checked, the second trigger should fire up, but it doesn't. Thanks for any help

A:

It does fire but because you're setting IsEnabled to fixed False value your style does not override it (Dependency Property Setting Precedence List). Try setting IsEnabled in your Style, like this 
<TextBox x:Name="AdmLnkTextBoxName1" />
<TextBox x:Name="AdmLnkTextBoxName2">
   <TextBox.Style>
       <Style TargetType="TextBox" >
           <Setter Property="IsEnabled" Value="False"/>
           <Style.Triggers>
               <DataTrigger Binding="{Binding ElementName=AdmLnkRadio1, Path=IsChecked}" Value="True">
                   <Setter Property="Text" Value="{Binding ElementName=AdmLnkTextBoxName1, Path=Text}"/>
                   <Setter Property="IsEnabled" Value="False"/>
               </DataTrigger>

               <DataTrigger Binding="{Binding ElementName=AdmLnkRadio2, Path=IsChecked}" Value="True">
                   <Setter Property="Text" Value=""/>
                   <Setter Property="IsEnabled" Value="True"/>
               </DataTrigger>

           </Style.Triggers>
       </Style>
   </TextBox.Style>
</TextBox>

