Reputation: 107
I know this question has come up here a few times, unfortunately the answers are outdated or didn't give me the result I wanted. AllocConsole doesn't seem to work that way either.
I need a terminal window for a WPF application for live console output. Whether embedded or as an external window.
In my application I have data that reads network packets via Photon. So this happens all the time without a break. If there is a problem in my app, this is the easiest place to look for the error.
A direct connection to a console window would be best, but I would also be satisfied with my own version of a console if it does not require a multiple of performance.
Does anyone have an idea how I can best do this? Simply ObservableCollection and then output by list?
Are there already such notification solutions?
Upvotes: 1
Views: 1011
Reputation: 585
If you're using .NET Core, you can create another logging provider and stream those updates to a UI.
If that's too big a paradigm shift, you can create a log reader that streams updates from a file on disk to a UI by opening a read-only stream and seeking to the file's end. This way would let you keep your logging implementation but requires considerations such as
Upvotes: 1
Reputation: 684
You might want to hop on over to the Terminal repo and show your support for microsoft/terminal#6999. We've got a WPF-backed terminal control in that repo that we've built, but it's not really production ready for third parties. Showing that you're interested in using it might help change the prioritization.
Upvotes: 2