I am well aware that the following is not officially supported and likely will not get a response from the NT support staff, but I am asking in the hope that someone in the community may have some information that might help me.
I have a piece of code that I need to execute once NT has loaded/enabled and rendered to the screen. I am aware that NT is likely a wpf STA thread application, likely using an automatically generated Main function. I have tried using Dispatcher.Invoke to execute my function and it works very nicely once NT is up and running (i.e. starting with a blank Workspace and just the Control Center window). However, and here is the issue, if I create a chart and save the workspace, and then relaunch NT, NT stalls. There are no error messages and nothing obviously wrong in the trace or log files. If I right click on the NT icon in the Windows taskbar a few times, it loads and works fine. It seems therefore that perhaps my code is somehow interfering in some way with MainWindow.Show() or the mechanism that renders the NT windows to the screen - the last bit before NT is ready to go. I am guessing here though.
So, does anyone know if there is an event (or something) that I might be able to subscribe to (or check) that would tell me whether NT is loaded and enabled so that I might execute my code on that event? Alternatively, has anyone tried running custom code async, or on another thread, and having it interact with the UI once NT has rendered to the screen? Any insight would be greatly appreciated. Thank you.
Comment