Search code examples
c#wpfwpf-controlsirc

WPF (irc) chat log control


I'm trying to learn WPF and was thinking about creating a simple IRC client. The most complicated part is to create the chat log. I want it to look more or less like the one in mIRC:

alt text

or irssi:

alt text

The important parts are that the text should be selectable, lines should wrap and it should be able to handle quite large logs.

The alternatives that I can come up with are:

  1. StackPanel inside a ScrollViewer where each line is a row
  2. ListView, since that seems more suitable for dynamic content/data binding.
  3. Create an own control that does the rendering on its own.

Is there any WPF guru out there that has some ideas on which direction to take and where to start?


Solution

  • I suggest you start with a good object model independent of the UI, and then try a multi-line TextBox or a RichTextBox.

    Whether these will suffice will depend on exactly how long you want the log to be able to get. If you run into performance issues, you may need to look at virtualization.