I want to dynamically load forms at runtime, anytime during the lifecycle of the application from a HTTP result (the forms are loaded from a web server).
They can change at any time.
I’ve tried loading GlideLoader.LoadWindow() in other places besides the ProgramStarted() method, and the form does load, but any events that I hook up throw this exception:
“An unhandled exception of type ‘System.NullReferenceException’ occurred in Microsoft.SPOT.TinyCore.dll”
When ran in ProgramStarted() everything runs fine.
Here’s the code I call when I get the window xml from the Http Request:
GlideTouch.Initialize(); // Resize any loaded Window to the LCD's size. Glide.FitToScreen = true; // Load the Window XML string. // Resources.GetString(Resources.StringResources.Window) window = GlideLoader.LoadWindow(windowXml); // Assign the Window to MainWindow; rendering it to the LCD. InitWin(); // set up the form events Glide.MainWindow = window;
Any help would be appreciated.