I am attempting to use the CompositeWPF library in my new desktop application but I am faced with an issue of which I cannot determine the best practice.
I have a third party library which processes some GPS data and provides me with a single object I can use containing a whole set of properties and an update function. I should call this update function so many times (the goal is between 20 and 50 times per
second) to retrieve and process new data. For that I created a seperate helper library which performs all the low level tasks.
public class Manager
public void UpdateLoopFromBackgroundThread()
Every time the update function is called about 20 properties from the third party library get updated.
Now I have 7 modules which should use the data from this third party library so each of them can draw different plots which are of course also update between 2 and 10 times per second. What's the best way to notify these modules they should redraw their
plot? I can't use change notifiers on the ThirdPartyLib object because the object itself doesn't change, and as far as I can tell putting those notifier events on each individual property is also not desired. I also don't like to create a custom class which
has the same properties as the ThirdPartyLib object and create a new one 50 times per second, that might be too hard for the Garbage Collector.
I was thinking of putting a timer in my module which is triggered every 500 or 100 milliseconds and to use the properties from the ThirdPartyLib object to update my views. I also considered using an event in the UpdateLoopFromBackgroundThread() function
on which my modules can add an event handler but I think that's not a correct use of the mvvm pattern, plus all those event calls might be quite expensive performance wise.
Any pointers on a correct solution are greatly appreciated. All the samples I encountered only processed relative static data so any articles or samples are always welcome.