I am trying to implement a piece of software that streams data from machine tools and saves the data it gets back as XML.
I currently have a GUI driven version which successfully creates a listener with the line
Task.Factory.StartNew(() => InitiateEventListener()); // Start the listener
I am creating a CLI version of this software as it needs to run headless on some machines and would like to be able to have a second window come up at this point to display all of the output driven by this method (the method continues to run until the connection is closed by either communication failure, manual stop, or an end of stream message given by the other device.) Unfortunately just running the method on a separate alone thread doesn't help me as my UI does not come back to user input, instead the window focuses on the new thread. If I could do this I would be able to launch multiple listeners with different search parameters from my CLI.