1
I have a text that color should alternate according to the method check below:
public Color VerificaAlarmes
{
get => ChecarLimites? AlarmColors: Color.Gold;
}
public Color AlarmColors
{
get
{
if (Value > AltoAlm)
return Color.Red;
else if (Value < BaixoAlm)
return Color.Green;
else
return Color.Gold;
}
}
This is the Binding in the text in XAML
<TextBlock Text="{Binding Descrição}"
Foreground="{Binding VerificaAlarmes}"
FontSize="18"
FontWeight="Semibold" />
I put the Color being type System.Drawing.Color only that the colors were not returned. Then I put the color being System.Windows.Media.Brushes and it didn’t work either, the returns of colors still don’t happen.