I tried to migrate 2 of my C++ Windows Store Applications from Windows 8.1 to Windows 10 this weekend and found that my user interface bindings were inoperable.
I build and update instances of my view model classes in the continuations of create_task() calls that I use to call FilePicker and StorageFile member functions. I have about 100 of these and they all worked fine in Windows 8.1. I have been using them in production for several months.
When I migrated the code. The continuations threw exceptions when I tried to reference or update model view classes. The exceptions indicated that the continuations were running on a different thread and did not have access to the information needed to type cast the WinRT objects that I was using in my view model and that they were being marshaled by a different thread.
I tried disconnecting the view model (Not setting its DataContext property) from my user interface. When I did that the exceptions moved down stream. The calls that I used to build the view model Collections seemed to be working but I received exceptions when I tried to reference or update any of my view model properties.
I received exceptions when I tried to open a popup menu from inside a create_task() continuation.
The tried the function calls that were throwing the exceptions outside of create_task() continuations and they worked fine.
Can you tell me what I need to do the resolve the problem. Is there a way to get them on a thread that has access to the view model memory and the information needed to the runtime type casting that they need to do.
The problem seems ironic because the objective of create_task() is to improve user interface performance. The issue has rendered it inoperable.
Thank you in advance for your help
Craig