T
TomB
Feel free to mock me....
I'm trying to figure out the Model View Controller pattern and thought I'd
try building a "simple" example.
I decided to go with a car.
The model is the engine, the dashboard the view and the pedals and steering
the controller.
My Engine has a System.Timers.Timer in it that fires every couple of
seconds. When it fires i calculated the fuel used and raise an event.
My dashboard catches this event and updates the fuel gauge.
I'm getting an error that I can't update the UI from a background thread.
("Cross-thread operation not valid: Control 'pbFuel' accessed from a thread
other than the thread it was created on.")
What's the background thread? The timer?
Thanks
Tom B
I'm trying to figure out the Model View Controller pattern and thought I'd
try building a "simple" example.
I decided to go with a car.
The model is the engine, the dashboard the view and the pedals and steering
the controller.
My Engine has a System.Timers.Timer in it that fires every couple of
seconds. When it fires i calculated the fuel used and raise an event.
My dashboard catches this event and updates the fuel gauge.
I'm getting an error that I can't update the UI from a background thread.
("Cross-thread operation not valid: Control 'pbFuel' accessed from a thread
other than the thread it was created on.")
What's the background thread? The timer?
Thanks
Tom B