I’m working with a charting tool that doesn’t support binding in the mvvm sense. So what I’ve decided is that I’d use a kind of messaging(like the MVVM Light’s messaging framework)service such that everytime the viewmodel observablecollection is updated, a message is sent which when received adds datapoints to the chart(this will be in the code behind unfortunately). Do you guys see any issues with this plan?
Share
I personally think that the messaging is a bit too excessive for what you’re trying to achieve, matter of taste though. Can you not use Adapter or attached behavior patterns? That’s what they typically use to substitute for the missing functionality. If you can instanciate your chart in Xaml (which I hope you do), I’d recommend to use attached behaviors, otherwise use and apater (for the elements which have no public constructors or any other tricky stuff) and instanciate it in the code.
For any class, which supports imperative calls only you can allways come up with a compensating behavior. here’s a quick sample:
Code:
XAML