hiding a label

May 21, 2009 at 10:17 PM

I am trying to hide a label based on its value = N/A as passed into the tag.  Does not seem to work any advice?

                    <Style TargetType="{x:Type Label}" x:Key="LabelTextStyle">
                            <Trigger Property="Tag" Value="N/A">
                                <Setter Property="Visibility" Value="Hidden"/>
                                <Setter Property="Background" Value="Blue"/>
                                <Setter Property="FontFamily" Value="Trebuchet MS"/>
                                <Setter Property="FontSize" Value="18"/>

                    <Label Style="{StaticResource LabelTextStyle}" FontSize="14" Tag="{Binding Path=lblCOO}" FontWeight="Bold" Foreground="#FFF9F7F7" Margin="23,9,59,36" Name="lblCOO" Grid.Column="3" Grid.Row="1"></Label>

May 22, 2009 at 9:39 PM

I just tried this in XAMLPad & it works fine.  I added some text to the label's content & replaced your binding for Tag with "foo" and it was visible, then with "N/A" and it was hidden.

Maybe you're binding isn't working correctly.