Reputation: 17530
I have a log file, in a memorystream, that can easily be read to a string. But I am not sure how i display this file best in WPF. I tried a TextBlock and binded it to the text property. But the application just dies when loading the file.
Are there other controls that will be good to show a log file within. There are no parameters, its just one record pr line of text that i would like to show and easy scroll within.
Every now and then a new line is added to the log and i need to update the view.
Using AvalonEdit , TextEditor loads fast and works nicely.
Upvotes: 1
Views: 2221
Reputation: 284
I'd make a ListView
with the ItemsSource
a list of the Records you have in your logfile.
When you use an ObservableCollection
as ItemsSource
, then you can easily update your view by adding the new record to the ObservableCollection
.
Edit:
With 100000 records this way will take some time to initialize due to creating a TextBlock
per record.
You could try the TextBox
control. Maybe this will work for your case. Binding the Text Property and add the new records to the bound string.
Or maybe this helps you.
Upvotes: 3