SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
I have been working on an application (with an internal library for building plots, and an adapter that creates the SciChart ViewModel implementation). All of my code makes heavy use of .Net 4.5’s Async API.
What I’ve noticed is that invoking the constructor on a RenderableSeries without the Dispatcher triggers the STA InvalidOperationException in PresentationCore. (Note that this is all happening during ViewModel construction, and before any changes have been made to the UI).
Is there any guidance on which parts of the SciCharts API require use of the UI thread?
RenderableSeries are indeed FrameworkElements and need to be instantiated on the UI thread. I would suggest do this create a factory class which you can inject into your ViewModels via dependency injection. The factory should also have the application dispatcher (given at startup, or in a bootstrapper if you are using a framework such as Prism). That way your viewmodels work at runtime and remain testable at test-time.
By the way if you want to see the base classes for types in the SciChart library, take a look at our online documentation which details the class hierarchy.
Hope this helps!
Please login first to submit.