2
Answers

TextBlock trigger does not work

Photo of markovalex

markovalex

1y
774
1

           <TextBlock Text="{Binding ElementName=flashControl, Path=OpenedFileName, Mode=OneWay}">
               <TextBlock.Style>
                   <Style TargetType="TextBlock">
                       <Style.Triggers>
                           <DataTrigger Binding="{Binding ElementName=flashControl, Path=FileOpened}" Value="true">
                               <Setter Property="TextBlock.Padding" Value="12,2,12,2"/>
                               <Setter Property="TextBlock.Background" Value="Black"/>
                           </DataTrigger>
                       </Style.Triggers>
                   </Style>
               </TextBlock.Style>
           </TextBlock>
 The "{Binding ElementName=flashControl, Path=FileOpened}" nicely works elsewhere except this trigger.

What am I doing wrong?...

Answers (2)