1

we got a WPF application based on the MVVM pattern. We show the logging data comming from a piece of hardware in a scrolling window. The logging data (just strings) are written by the hardware continously into an ObservableCollection in the ViewModel. This works fine. The capacity of the ObservableCollection is limited, e.g. to 1000 lines. As soon as the limit is reached we want to remove older lines and fill in new logging data. (We would need a ring buffer) We tried to remove the first 30% of the collection an move the rest down to the beginning. But this didn't work with such a Collection. We also tried to use a Queue, which makes sense. But the WPF window did not update: Binding dosen't work. Got any idea? Thanks

SunnyApril

SunnyApril
  • 93
  • 4
  • Maybe here you can find a solution [1]: http://stackoverflow.com/questions/4266654/binding-to-queuestring-ui-never-updates – michele Aug 08 '12 at 14:22
  • Why not just add the log data and just remove the last object of the Observable Collection if the size is > 1000 ? – GameAlchemist Aug 08 '12 at 14:28
  • What did not work when you removed a row from the ObservableCollection? You could bind to a List of exactly 1000 when you get a new value update the entire list. – paparazzo Aug 08 '12 at 15:11

0 Answers0