Silverlight Serialize/Desirialize

2 posts, 0 answers
  1. CapriconF
    CapriconF avatar
    1 posts
    Member since:
    May 2015

    Posted 27 May 2015 Link to this post

    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();

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

  2. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 01 Jun 2015 Link to this post

    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;

    Hope this helps.

    Boyan Boev
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top