There seems to be a lot of these errors found on the forum, but I can't apply most of them on my situation..
My problem:
I have a page: PosterHome.xaml, with a uniform grid on it. In my code-behind, I have a drawthread:
drawThread = new Thread(new ThreadStart(drawPosters));
drawThread.SetApartmentState(ApartmentState.STA);
drawThread.Start();
This threadmethod (drawPosters) is occasionally woken up by another class, using a autoresetevent. I get the error in this method the moment i'm changing the uniform grid rows:
while (true)
{
waitEvent.WaitOne();
//do some calculations
// change uniform grid rows & cols
posterUniformGrid.Rows = calculatedRows; //**-> error is first thrown here**
posterUniformGird.Columns = calculatedCols;
}
How should I handle this? Thanks in advance.
Greets Daan