I have a Table
control, and I want to fill it with colors, with a delay of X
milliseconds between each paint.
This a very general example of what I am doing (It's longer, but I deleted the unimportant lines):
private void myFunc()
{
while (SOME_CONDITION) {
Thread.Sleep(X_MS);
this.myTable.RowGroups[0].Rows[SOME_ROW].Cells[SOME_COLUMN].Background = Brushes.Blue;
}
}
The above just freezes the Window
until the function is done, and paints the desired cells in a single moment.
I know I shouldn't use Sleep
, but when I worked on a console application, it was an easy solution. Any suggestions?