0

Possible Duplicate:
Elegant Log Window in WinForms C#

I need a log-viewer to check the DB for new logs every few seconds and append them to a WinForms or WPF control. The control can have a buffer like command prompt and keep only the last [buffer size] lines.

What can I use for this?

Community
  • 1
  • 1
Şafak Gür
  • 7,045
  • 5
  • 59
  • 96
  • @Surfbutler: Just saw it, it's for WinForms only though. What I need is a control that displays text and has a buffer for WinForms *or* WPF. – Şafak Gür Oct 06 '12 at 17:21
  • I don't think you'll find anything that will do both, not for the visual parts anyway, the environments are too different. – Surfbutler Oct 06 '12 at 18:09
  • @Surfbutler: I don't look for anything that will do both. I need WinForms **or** WPF. – Şafak Gür Oct 06 '12 at 18:53

1 Answers1

0

If you are going to use WPF, then ListBox control can work as display control. You can define various templates using ItemTemplate property of ListBox(based on log type)

This ListBox can be bound to Observable collection of ViewModel/DataContext.

You can then define your business logic in viewmodel to add/ remove entries from ObservableCollection. Changes in ObservableCollection will get reflected in Xaml UI due to binding.

[Note - You can use any other itemscontrol, there is no compulsion of using ListBox]

RockWorld
  • 1,278
  • 2
  • 11
  • 24