This is a migrated thread and some comments may be shown as answers.

Silverlight Serialize/Desirialize

1 Answer 38 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
CapriconF
Top achievements
Rank 1
CapriconF asked on 27 May 2015, 08:55 PM

Trying desalinize  ArtOfTest.WebAii.Silverlight.UI.Color object. First I I called serialize method and got string - "{\"A\":255,\"B\":128,\"G\":128,\"R\":128}"

Then I try:
 ArtOfTest.WebAii.Silverlight.UI.Color colorGr = new Color();
            colorGr.Deserialize("{\"A\":255,\"B\":128,\"G\":128,\"R\":128}");

When I check properties of colorGr - nothing been set???

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 01 Jun 2015, 10:55 AM
Hi Igor,

Unfortunately Deserialize method doesn't set the property directly. It returns an object. You should modify your code as follows:

Color color = new Color();
Color c = color.Deserialize("{\"A\":255,\"B\":128,\"G\":128,\"R\":128}") as Color;
Log.WriteLine(c.Serialize().ToString());

Hope this helps.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
CapriconF
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Share this question
or