Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommendations for making a Log Window in WPF

I'm currently working on a Log Window for my application that looks and behaves just like the Output Window in Visual Studio. It can be bombarded by thousands of messages per second, and it needs to handle a very large log (hundreds of thousands of lines).

So far, I've made one quickly by using a RichTextBox and it works well. I used the RichTextBox instead of a TextBox because I thought it might be nice to eventually format error messages with a color.

Is the RichTextBox a good choice or are there better alternatives? And is there any other recommendations to follow to make it as efficient as possible?

like image 910
Anthony Brien Avatar asked Nov 06 '22 21:11

Anthony Brien


1 Answers

Queue the messages and let a background thread format them. I'd also suggest making the the window a view on a section of the queue so that the window doesn't have to fill up.

like image 129
Preet Sangha Avatar answered Nov 15 '22 05:11

Preet Sangha