Is there a way to pass parameters into an InfoPath FormControl hosted in a WinForms/WPF application the way they can be passed via a URL and the command line? Our forms depend on parameters passed to them on startup to execute a custom data connection to pre-populate them, but the control does not appear to support parameters.
A bit of background on what I'm trying to do and what I've tried so far:
We are able to download individual forms and populate them with data from a web page and are now working to build functionality to support "form packages". This involves downloading multiple InfoPath forms to a user's workstation, displaying them one at a time for data entry, printing the form, displaying the next form, and so on.
I briefly looked into programmatically merging multiple forms into a single InfoPath file on the server and then downloading that to the client, but manipulating the multiple files in each XSN/CAB would require an in-depth knowledge of the inner workings of InfoPath that I don't have nor have a way to obtain. Unfortunately, these form packages have to be assembled on-the-fly or presented in sequence because they are used both individually as well as in package form.
Next, I researched doing this in a simple C# console application using Process.Start to launch each form from the command line with the required input parameters, but knowing when each form is closed so the next one can be loaded is somewhat clunky. We'd also like to background load subsequent forms while the user works with the current form, but InfoPath seems to be ignoring the ProcessWindowStyle.Hidden I'm passing via the ProcessStartInfo instance.
From there, I moved on to researching what it would take to develop a WPF application to host the forms in the InfoPath FormControl. This would allow forms to be loaded in the background and a couple navigation buttons would allow the user to move between forms and is currently the leading option provided I can find a way to pass parameters to the form on startup.
Thanks for taking the time to read this and for any help you can provide!