We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Serialize : XamlRader.Parse throws Exception for set DataModel.CharListData

I saw serialization was added on 8.4.
I start from RangeAreaChart that I modify getting 3 chartseries. On Serialized (XamlWriter.Write) it's ok I've a string that's my object (I serialize the ChartSerie root).

But when I Parse xml for creating my object, I got this error :

XamlParseException : Set property 'Syncfusion.Windows.Chart.ChartDataModel.ChartPoints' threw an exception.

InnerException : Object of type 'System.String' cannot be converted to type 'Syncfusion.Windows.Chart.ChartListData'.


Part of generated string, about ChartDataModel :






///Fucntion for save => creating string from xmal object
private void Save_Click(object sender, RoutedEventArgs e)
{
String s = System.Windows.Markup.XamlWriter.Save(Chart1);
SaveValue.Text = s;
}

/// Function for create object with string
private void Load_Click(object sender, RoutedEventArgs e)
{
Chart1 = (Chart)System.Windows.Markup.XamlReader.Parse(SaveValue.Text); //I Got error here
AddDataToSeries(); //populate data
}


I don't populate chart before save/restore, so I don't understand why this error.

I read you set a minimal support for serialize, can we got more informations about what we can/cannot serialize ?

Thanks :)

Arnard




Window1.xaml_6f14f6c1.zip

4 Replies

AR Arnard November 12, 2010 02:56 PM UTC

I would look into Syncfusion_Chart.WPF_2010 for ChartDataModel class definition (C:\Program Files (x86)\Syncfusion\Essential Studio\8.4.0.10\WPF\Chart.WPF\Src), VS 2010 found the property ChartSerie.ChartDataModel, but no class ChartDataModel...

If I open the syncfusion.chart.wpf dll in reflector (version .net 4.0), ChartDataModel is here, so I don't understand, are the source not up to date ?

Thanks



SN Senthilkumar N Syncfusion Team November 15, 2010 04:49 AM UTC

Hi Arnard,

Thanks for choosing Syncfusion Products.

We have already identified and fixed your mentioned issue in our latest source.

Please create a Direct-trac incident for this issue, so we will update you the custom patch with fix for this issue.

We use ChartDataModel class as shared class for Syncfusion.Chart.Silverlight and Syncfusion.Chart.Wpf, so it is available in Syncfusion.Chart.Silverlight.

Please Let us know if you have any Queries.

Regards,
Senthilkumar




AR Arnard November 18, 2010 03:16 PM UTC

Very Well, I tried it, it's nice !

And there is few limitations for serialization : only BindingY, AxeX, AxeY, it's nice if the others properties are ok !



SN Senthilkumar N Syncfusion Team November 19, 2010 05:11 AM UTC

Hi Arnard,

We are glad to hear that your problem has been resolved. Please do not hesitate to open a new support incident if you ever need further assistance from us.

Thanks for choosing Syncfusion Products.

Regards,
Senthilkumar





Loader.
Live Chat Icon For mobile
Up arrow icon