3

I'm writing an application that needs a log-like view, (similar to how an IM client displays messages in the conversation), with potentially many updates per second. Speed is an issue here; the application locking up due to a large number of incoming events is a possible problem. I need selection and basic text formatting, so manual rendering could get quite complex, I'd like to avoid it if possible. I'd also like to bottom-anchor the scroll bar, that is, if it's at the bottom, stay at the bottom when the new item is added. What would be a good way to implement this?

Eric
  • 851
  • 7
  • 16

2 Answers2

5

You can implement it very easily in WPF.

  1. Create an ObservableCollection of Log entities and bind to a ListBox.
  2. Give a DataTemplate for the ListBox.ItemTemplate.

*When running in real time you need either UI side or Data side virtualization Check out my PaginatedObservableCollection so that the DataVirtualization will automatically function.

Jobi Joy
  • 49,102
  • 20
  • 108
  • 119
0

I think you should have a look at ListView/ListBox controls, they support UI virtualization and provide functionality you're looking for. Also you can improve performance by data virtualization/lazy loading - i.e. don't hold invisible items in memory and load required data on demand

aku
  • 122,288
  • 32
  • 173
  • 203