Поместите в свой шаблон триггер, который заменит {TemplateBinding Foreground}
на "{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"
и наоборот, когда ваш элемент управления находится в выбранном состоянии. Вы не можете использовать TemplateBinding из сеттера, поэтому вам нужно использовать обычную привязку с RelativeSource of TemplatedParent. Вот пример CheckBox с TextBlock, который инвертирует цвета при проверке:
<CheckBox Foreground="Blue" Background="LightGreen">
<ContentControl.Template>
<ControlTemplate TargetType="CheckBox">
<TextBlock Name="TextBlock"
Background="{TemplateBinding Background}"
Foreground="{TemplateBinding Foreground}"
Text="Text">
</TextBlock>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="TextBlock" Property="Background"
Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}"/>
<Setter TargetName="TextBlock" Property="Foreground"
Value="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ContentControl.Template>
</CheckBox>