Click here to Skip to main content
12,078,070 members (45,616 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: WPF infragistics
I am able to use a ValueConverter to do what I need to, but would like to change this to a tigger. My problem is how to refer to the Content:

<Style x:Key="BrokerCellPresenter2"
       TargetType="{x:Type igDP:CellValuePresenter}">
  <Style.Resources>
    <Converters:IfTrueValueConverter x:Key="InvisibleIfNullConverter"
                                     TrueValue="Visible"
                                     FalseValue="Hidden"
                                     NullValue="Hidden" />
  </Style.Resources>
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
        <Border Name="border"
                Visibility="{TemplateBinding Content, Converter={StaticResource InvisibleIfNullConverter}}"
                removed="#A50021"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch">
          <Polygon Points="1,0 0,1 4,5 0,9 1,10 5,6 9,10 10,9 6,5 10,1 9,0 5,4"
                   Fill="White"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center" />
        </Border>
        <!--<ControlTemplate.Triggers>
          <DataTrigger Binding="{TemplateBinding Content}"
                       Value="true">
            <Setter TargetName="border"
                    Property="Visibility"
                    Value="Visible" />
          </DataTrigger>
        </ControlTemplate.Triggers>-->
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

I have the trigger commented out because I cannot seem to get the content which is a boolean. Only want the x to display if the value is true.
Posted 5-Jun-12 11:07am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi Clifford,

Try to use the following trigger:

<Trigger Property="Content" Value="{x:Null}">
...
</Trigger>

Regards,
Rob
  Permalink  
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160212.1 | Last Updated 25 Jun 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100