I have a list of boolean values named Sequence. I want to change the color of a shape based on the values of the list, that is, I want to iterate through the values of the list and fill the shape with a certain color (for example yellow) every time I stumble upon a True value and change the color of the filling (to blue) every time I stumble upon a False value. I have tried doing it like this:
foreach(bool element in Sequence)
{
if(element){ ellipse.Fill = new SolidColorBrush(Colors.Yellow); }
else{ ellipse.Fill = new SolidColorBrush(Colors.Blue); }
int milisecond = 200;
Thread.Sleep(miliseconds);
}
But still the colors won't alternate.
Here's the XAML:
`<Ellipse x:Name="elipse" Height="100" Margin="151,52,0,0" Stroke="Black" Width="100" /> `
Do I need a trigger?, What am I doing wrong?. Thank you in advance, and excuse my bad english if something seems funny.