I have no idea what is wrong, and how I am supposed to solve the error. Strangely enough, the data triggers work fine.
<Style TargetType="Border">
<Setter Property="Background" Value="{StaticResource HeaderBackgroundBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding State}" Value="{StaticResource ErrorState}">
<Setter Property="Background" Value="OrangeRed"/>
</DataTrigger>
<DataTrigger Binding="{Binding State}" Value="{StaticResource ProductionState}">
<Setter Property="Background" Value="Green"/>
</DataTrigger>
</Style.Triggers>
</Style>
ProductionState and Error states are enum values referenced in XAML:
<machineControl:MachineControllerState x:Key="ErrorState">Error</machineControl:MachineControllerState>
<machineControl:MachineControllerState x:Key="ProductionState">Production</machineControl:MachineControllerState>
The State binding references to the view model which is "a normal" property which supports IPropertyChanged (from mvvm lights lib)
public MachineControllerState State
{
get => state;
set { Set(() => State, ref state, value); }
}
visual studio shows the error in error list:
After a data trigger is in use (sealed), it cannot be modified
Update: to be clear, the solution compiles fine, and runtime everything works as expected.