I am creating my first WPF application, which is an IRC chat program. Since I am new at WPF, I don't really know how should I display the messages, because they can contain bold, italic words or even images or a quiting message has other color then a simple message.
I was searching on the net and I found some solutions. First type of the solutions is using a RichTextBox with a FlowDocument or just a simple FlowDocument and hack their binding system somehow to display the value of a property. About "hacking" I mean, that these controls doesn't have binding properties, because they are not DependencyObjects. (I am not sure that this is the right expression).
In just a simple TextBlock I can't display the messages, because it displays the value of a string. After having a lot of messages in a simple string and adding a new one to it needs a lot of memory copy, since a string can't be modified. And furthermore if I use a TextBlock, then can I select it's content with my mouse to copy from it? If I use a readonly TextBox, then can I use styling for only one word for example?
So I am about to use a ListView or something that can display the content of a List (or any collection) and then modify its template to display each message correctly. (And disable selection of the ListView somehow) But I don't know what control should I use for the messages to display them stylish and to make them selectable.
Using a list to store the messages would be cool, because after having ~1000 messages, then I would like to remove the first 100 ones to save them in a log file.
So I am totally confused about how to solve this problem. I hope somebody will have a proper solution for this kind of problem!