title: XAML controls binding with another controls which are in datatemplate !
body: <p>i have the following datatemplate in xaml and here i have textbox in datatemplate and button in normal XAML, what i really want is that i want to keep button be disabled until person enters something in textbox ? but its not working i have tried the follwing code </p>
  
  <p>Please look into it and help me as well ! or is there any other way to do this let me know !</p>
  
  <pre><code> &lt;UserControl.Resources&gt;
      &lt;DataTemplate x:Key="dataTemplateParameter"&gt;            
          &lt;StackPanel Width="170" Height="Auto" Margin="5"&gt;
              &lt;TextBlock Width="160" TextAlignment="Left" HorizontalAlignment="Left" Height="22" Text="{Binding Path=ParameterName, Mode=TwoWay}"/&gt;
              &lt;TextBox x:Name="txtboxParameter"  Width="160" Height="22" HorizontalAlignment="Left" Text="{Binding Path=ParameterValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
          &lt;/StackPanel&gt;            
      &lt;/DataTemplate&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;Button  Grid.Row="6" Name="SearchSourceParamBtn" Content="Search" VerticalAlignment="Bottom" Margin="12,5,92,0" Height="20" Visibility="{Binding SearchSourceBtnVisibility}" Command="{Binding SearchCommand}"&gt;
          &lt;Button.Style&gt;
              &lt;Style TargetType="Button"&gt;
                  &lt;Setter Property="IsEnabled" Value="True"/&gt;
                  &lt;Style.Triggers&gt;
                      &lt;DataTrigger Binding="{Binding Text,x:ElementName=txtboxParameter}" Value=""&gt;
                          &lt;Setter Property="IsEnabled" Value="False" /&gt;
                      &lt;/DataTrigger&gt;
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;
          &lt;/Button.Style&gt;
      &lt;/Button&gt;
  </code></pre>
  
  <p>Thanks
  nallskarthi</p>