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
|
Hi there, i've just loaded the Mindscape WPF Elements trial and want to test how to work with it. But I can't get even the examples to run because of problems with the static resources and the Build* commands which are used in the examples. In Visual Studio I get messages like "The resource 'AxisStyle' could not be resolved" and "The name 'BuildScatterData' does not exist in the current context" and aren't able to build it. If I remove the BuildScatterData command I can build but when I try to run it I get the exception: "Provide value on 'System.Windows.StaticResourceExtension' threw an exception" Here's what I've done:
Thanks for your help! MainWindow.xaml:
MainWindow.cs:
|
|
|
Hello Josch Are you experiencing these issues by running the actual SampleExplorer project as well? or are you only seeing these from your project? In this forum post I'll mention looking at the code from the SampleExplorer. You have access to all the code for the sample explorer by going to the Windows Start Menu -> Mindscape -> WPF Elements -> Samples. This runs up a Visual Studio solution with a few samples including the SampleExplorer. In the SampleExplorer, there are a lot of different chart demos, and they all display randomly generated data. A lot of the chart demos share the same method for randomly generating the data, so these methods have been put into a base class that all the chart demos extend from. If you open the SampleExplorer demo in visual studio and go to the ScatterChartDemo.xaml.cs file, you will see it extends the ChartDemoBase class. This base class - which is part of the SampleExplorer code, is where the Build* methods are. You'll want to copy the BuildScatterData method into your project. Similarly, all the charts share similar styles which have all been put in a resource dictionary of the SampleExplorer. To resolve the StaticResourceExtension issue, there are 2 options: 1) In your xaml, you can remove the SymbolStyle from the ScatterSeries, and the Style from the ChartAxis. Or 2) you could find these resources in the sample, and put them in App.xaml of your project. These resource can be found in App.xaml of the SampleExplorer, but I've also pasted them here for convenience. Note that these resources are not required to use our Chart controls. These are just used to get nice visuals in the SampleExplorer - or your own application if you wish to use them.
You'll also notice that in the xaml of your project, the ScatterSeries.SeriesBrush properties are binding to a "Palette" collection property. This is also found on the ChartDemoBase class so that in any of the chart demos, the colors of the data points can be changed using the color picker in the options panel on the right. You can replace these bindings with hard coded colors in you application. Sorry for the confusion caused by copying the code from the SampleExplorer. We will look into ways to improve this experience. Let me know if you have more questions about the chart controls and I'll be able to help you out. Jason Fauchelle |
|
|
Thank you very much Jason! This helped a lot and I got it working.... |
|