datagrid value to change a textbox to collapsed
<p>If a particular value in a selected row of datagrid is 1, I want to have a separate textbox collapsed.</p>

<pre><code>&lt;TextBox 
    x:Name="TextBoxDetailsSafetyFactor" 
    Height="21" 
    Margin="0,0,2,15" 
    TextWrapping="Wrap"  
    VerticalAlignment="Bottom" 
    HorizontalContentAlignment="Center" 
    RenderTransformOrigin="0.487,0.507" 
    HorizontalAlignment="Right" 
    Width="96"
    &gt;
    &lt;TextBox.Style&gt;
        &lt;Style TargetType="{x:Type TextBox}"&gt;
            &lt;Style.Triggers&gt;
                &lt;DataTrigger Binding="{Binding SafetyFactor}" Value="1"&gt;
                    &lt;Setter Property="Visibility" Value="Collapsed" &gt;&lt;/Setter&gt;
                &lt;/DataTrigger&gt;
            &lt;/Style.Triggers&gt;
        &lt;/Style&gt;
    &lt;/TextBox.Style&gt;
&lt;/TextBox&gt;
</code></pre>

<p>Code that works in the grid is below:</p>

<pre><code>&lt;/DataGridTemplateColumn.CellTemplate&gt;
                                            &lt;DataGridTemplateColumn.CellStyle&gt;
                                                &lt;Style TargetType="{x:Type DataGridCell}"&gt;
                                                    &lt;Style.Triggers&gt;
                                                        &lt;DataTrigger Binding="{Binding SafetyFactor}" Value="1"&gt;
                                                            &lt;Setter Property="Visibility" Value="Hidden"&gt;&lt;/Setter&gt;
                                                        &lt;/DataTrigger&gt;
                                                    &lt;/Style.Triggers&gt;
                                                &lt;/Style&gt;
                                            &lt;/DataGridTemplateColumn.CellStyle&gt;
                                        &lt;/DataGridTemplateColumn&gt;
</code></pre>

<p>I have used this code in another cell in the data grid to collapse.  I now want to collapse a text outside of the datagrid.</p>