DataTrigger for Textblock

Viewed 21671

I have a Textblock that I'm trying to change the value of the Text property if a property is True or False. The issue I'm having is that the flag could be changed on different events on the screen (onchange events from other combo boxes).

I'm not sure how to get this datatrigger to work as I don't think it know when the value has been changed.

<TextBlock Grid.Row="9" HorizontalAlignment="Right" Text="Some Old Value:" VerticalAlignment="Center">
    <TextBlock.Style>
        <Style TargetType="{x:Type TextBlock}">
             <Style.Triggers>
                 <DataTrigger Binding="{Binding IsChecked}" Value="False" >
                     <Setter Property="Text" Value="Different Text:"/>
                 </DataTrigger>
             </Style.Triggers>
         </Style>
     </TextBlock.Style>                                
</TextBlock>

I see in some comboboxes there is the UpdateSourceTrigger=PropertyChanged, but I don't see a way to implement that in the TextBlock.

1 Answers
Related