title: wpf Change IsEnabled property of Button control and Text property of TextBlock which placed inside the Button control
body: <p>I have a <code>Button</code> control inside a <code>DataTemplate</code> for my <code>ListBoxItem</code> with a <code>TextBlock</code> inside it:</p>
  
  <pre><code>&lt;DataTemplate x:Key="SomeitemTempate"&gt;
  ....
  &lt;Button x:Name="nxBut" Margin="20,0,20,20" Height="30" DockPanel.Dock="Bottom" FontSize="16" Background="White" Click="nxBut_Click"&gt;
       &lt;TextBlock x:Name="nxBut_Txt" Text="Some Button" FontWeight="Bold" Foreground="#FF11700C"/&gt;
  &lt;/Button&gt;
  ....
  </code></pre>
  
  <p>Now when user clicked the <code>Button</code>, I want to change <code>IsEnabled</code> property of the button to <code>False</code>, and the <code>Text</code> of the <code>TextBlock</code> to "Clicked". After googling for some times, i modified it:</p>
  
  <pre><code>    ....
      &lt;DataTemplate.Triggers&gt;
          &lt;DataTrigger Binding="{Binding ElementName=nxBut, Path=IsPressed}" Value="True"&gt;
              &lt;Setter TargetName="nxBut" Property="IsEnabled" Value="False" /&gt;
              &lt;Setter TargetName="nxBut_Txt" Property="Text" Value="Clicked"/&gt;
          &lt;/DataTrigger&gt;
      &lt;/DataTemplate.Triggers&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>But it does not work. What am I doing wrong?</p>