context

Accessing unmanaged code in separate context in WPF

By on March 1, 2010

In order for Windows Forms controls to work correctly in .NET Framework it is necessary to access their methods and properties from the same context that they were created in, otherwise they may display unpredictable behaviour. Usually this is a concern when using multiple threads, some of which need to modify a control’s state. All of this is also relevant for Windows Presentation Foundation (WPF) technology. However, in WPF such an issue may also arise when using a DLL with unmanaged code — this does not occur in WinForms. We’ll show an example how one can solve this issue by calling methods from the DLL in a separate context.

(more…)