Column style with color background, related to field value

Build 1501 on 14/Nov/2017  This topic last edited on: 6/Sep/2016, at 13:33

The below example shows a color gradient rectangle, whose color is related to the workstate of the object.

workstatecolor

<ColStyle Name="W" Width="20" SortName="Workstate">

  <CellTemplate>

    <Rectangle VerticalAlignment="Center"  Width="30" Height="20" ToolTip="{Binding Path=[task.calendarRef.workstateRef.name]}" >

      <Rectangle.Fill>

        <LinearGradientBrush StartPoint="0,0">

          <GradientStop Color="White" Offset="0.0"/>

          <GradientStop Color="{Binding Path=[task.calendarRef.workstateRef.color], Converter={StaticResource ColorConverter}, FallbackValue=White}" Offset="1.0"/>

        </LinearGradientBrush>

      </Rectangle.Fill>

    </Rectangle>

  </CellTemplate>

</ColStyle>