Good,
I am developing a program in Framework 3.5 in WPF (xaml) and the problem that occurs to me is that when I want to change the color of a line from the class code, when the grid already has the data that I want to show, I can't find the way.
XAML code:
<ListView.View>
<GridView>
<GridViewColumn Header="#" DisplayMemberBinding="{Binding Path=position}" my:clsGridViewSort.PropertyName="position"></GridViewColumn>
<GridViewColumn Header="{x:Static prop:Properties.Resources.NombreArchivo}" DisplayMemberBinding="{Binding Path=filename}" my:clsGridViewSort.PropertyName="filename" />
<GridViewColumn Header="{x:Static prop:Properties.Resources.FechaInicio}" DisplayMemberBinding="{Binding Path=startdate}" my:clsGridViewSort.PropertyName="startdate" />
<GridViewColumn Header="{x:Static prop:Properties.Resources.FechaFin}" DisplayMemberBinding="{Binding Path=enddate}" my:clsGridViewSort.PropertyName="enddate"/>
<GridViewColumn Header="{x:Static prop:Properties.Resources.UltimaCopia}" DisplayMemberBinding="{Binding Path=lastbackup}" my:clsGridViewSort.PropertyName="lastbackup"/>
<GridViewColumn Header="{x:Static prop:Properties.Resources.Estado}" DisplayMemberBinding="{Binding Path=state}" my:clsGridViewSort.PropertyName="state"/>
<GridViewColumn Header="{x:Static prop:Properties.Resources.Periodicidad}" DisplayMemberBinding="{Binding Path=period}" my:clsGridViewSort.PropertyName="period"/>
<GridViewColumn Header="{x:Static prop:Properties.Resources.Ruta}" DisplayMemberBinding="{Binding Path=path}" my:clsGridViewSort.PropertyName="path"/>
<GridViewColumn Header="{x:Static prop:Properties.Resources.EspacioActual}" DisplayMemberBinding="{Binding Path=actualsize}" my:clsGridViewSort.PropertyName="actualsize"/>
</GridView>
</ListView.View>
In this example the gridview rows change color according to the status value (3: red, 2: yellow)
Code behind:
Result:
you can also do something like:
this would be a trigger for mauseover.