<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Foreground" Value="Red"/>
</Style>
CellValuePresenter と DataRecordCellArea はどちらも、前景関連のプロパティなど、スタイリング時に競合を引き起こす可能性のあるいくつかのプロパティを共有しています。CellValuePresenter は DataRecordCellArea 内に存在するため、セルに加えられたすべての変更が優先されます。
CellValuePresenter を介して前景を直接変更する例を次に示します。
XAML の場合:
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Foreground" Value="Red"/>
</Style>
DataRecordCellArea のスタイルを設定する必要がある場合は、前景をネストされたスタイルとして記述するか、ForegroundStyle を null に設定して CellValuePresenter をオーバーライドする必要があります。
XAML の場合:
<Style TargetType="{x:Type igDP:DataRecordCellArea}">
<Setter Property="Foreground" Value="Red"/>
<Setter Property="ForegroundStyle" Value="{x:Null}" />
<!--OR-->
<Setter Property="ForegroundStyle">
<Setter.Value>
<Style>
<Setter Property="TextBlock.Foreground" Value="Red" />
</Style>
</Setter.Value>
</Setter>
</Style>-