Hey all
I've been developing in c# for a few months now, but to my shame have only recently started looking at threads. And now that I do look at them, I'm having issues...
Here's a sample of my code:
private void cmdNext_Click(object sender, RoutedEventArgs e)
{
...
Thread t = new Thread(new ThreadStart(obj.makeGraph));
t.Start();
...
}
public void makeGraph()
{
...
if ((Boolean)radioProduct.IsChecked)
{
...
}
...
The code builds perfectly, but when I run it I get an "InvalidOperationException was unhandled" when I try to run the if statement. Apparently "The calling thread cannot access this object because another thread owns it." Any idea of where I'm going wrong, or what I can do to fix it?
Thanks in advance