In standart dotnet I can use InvokeRequired to see if I need to use Invoke before accessing a control.
How do I do that in standard netmf?
I’m playing with the sample “A Graphing Altimeter” at gadgeteering.net and i ported the gadgeteer driver for the humidity sensor over to standard netmf, but the MeasurementComplete event runs in a different thread and it give an System.InvalidOperationException exception when I try to call Invalidate on a canvas.
Wouldn’t CheckAccess always return true if you check against the Dispatcher.CurrentDispatcher? You want the dispatcher
for the thread that was used to create the graphic object.
Ahh, I ripped appart gadgeteer’s CheckAndInvoke but didnt understand what was going on. There is a lot of fluff around it. And this code complained about requiring a static method or something.
This did the trick.
ThanksArchitect and Mike. I have beed struggling with this all evening, and you guys helped me fix it in 15 mins.