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?
Asked
Active
Viewed 3,211 times
2 Answers
5
You can implement it very easily in WPF.
- Create an ObservableCollection of Log entities and bind to a ListBox.
- 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