We're looking to port a massive MFC app to WPF. In the interim, we want to host the new WPF controls in the legacy app until the entire app has been replicated. Hosting WPF controls in MFC is pretty straightforward, but one of the challenges we've had in the past is sharing data between the hosting MFC app and the hosted WPF control. In our case the MFC app has a rich hierarchy of data objects that drive the behavior of the application. When we've done this in the past with WinForms on .NET 2.0/3.5, we've created dedicated types in .NET to model the data and marked them with ComVisible=true. The MFC app then constructs, hydrates, and passes those objects to the hosted control.
Will the "dynamic" keyword in .NET4 going to make this any easier? I would really like to be able to pass the MFC types as-is and save the effort of creating dedicated types to marshal the in-memory types to the hosted controls.