This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
My company just purchased your package (yesterday in fact) and I'm having troubles trying to get a chart to work correctly. This may just be because I'm not experienced yet in your software. We use the MVVM pattern in our software and we are trying to dynamically create line series on a chart based on user selection. Sometimes a user only wishes to see one series, sometimes they need to select up to twenty or so. In my viewmodel I created an Thanks |
|
|
Hello The Series property needs to be read only in order for the ContentProperty attribute to work in a convenient manner. This allows you to add data series to the Series collection in xaml without needing to create the collection itself. This sort of thing is know to be a pain for MVVM applications because you can't bind the property. Fortunately there is a way to work around this while keeping your code clean: It is possible to create an attached property that includes logic for synchronising 2 observable collections - The one provided by the Series property, and the one in your model. You can read more about how to do this from here: http://blog.functionalfun.net/2009/02/how-to-databind-to-selecteditems.html. This blog is related to binding to the SelectedItems property of a ListBox, but you can use a similar approach for binding to the Series property of a Chart control. For convenience I have attached a sample that demonstrates this. To run the sample, make sure to include a reference to your copy of the Mindscape.WpfElements.dll. The Series property is being synchronised by setting the attached property like this:
Where MySeries would be a property on the view model. When you press the button under the chart, a new bar series is added to the collection in the code behind which as you can see updates the Series collection for the chart. Note: to get this to work fully, you'll need to get the next nightly build which fixes a bug. This will be available at around 1200GMT which you can download from your account page. Let me know if you have any questions about this. Jason Fauchelle |
|
|
Awesome... this will work just fine. Thanks for the quick and thorough response. |
|