Databinding and JsonObject RRS feed

  • Question

  • Hello,

    I'm not sure i'm in the right place for this, but...

    So, I'm using JsonObject to manager a remote REST service. I know I could use the Json DataContract serializer, but the form of the remote json and it's non "standard" nature prevent me to use plain objects". I use the JsonObject in all my solutions, and it's working pretty well (except iteration on array, but a simple trick made it, until the bug fix appear)

    I just have a problem when i try to use the indexer binding.

    For instance: I set the DataContext of my UserControl to an IEnumerable<JsonObject>.

    If I use the {Binding Path[name]} I got nothing.

    I made a IValueConverter to workaround it. But this prevent me using a IValueConverter when I really need it (to get date from a string). and my converter is becoming very complex due to this situation.

    Does anyone here has a better solution?



    Monday, January 9, 2012 11:03 AM

All replies

  • Hi Cedric - are you saying that you aren't able to pull the a key/value pair out of a JSONObject?
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    Monday, January 16, 2012 5:14 PM
  • Now I have the same question for Win8 CP.

    I have an json object like this one:

      name: "blabla",
      type: "aType"

    I want to use Databinding to show the Data (the name, or the type). But when I use the following Databinding {Binding Path=[name]}, I have a IJsonValue, not the string I want. A solution is to use Converters, but then, I have to create (and use) many converters. I would be simplest to have a JsonObject "family" able to natively databound to the UI.

    Monday, April 16, 2012 1:17 PM
  • I can look at this if you want to send a project:  MSMALL at Microsoft

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Monday, April 16, 2012 1:55 PM
  • Hi Cedric - One of our XAML Databinding PMs will come on this thread to address the issues around databinding to JsonObjects.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Tuesday, April 17, 2012 4:58 PM
  • Hi Matt,

    Any news from the PMs?


    Thursday, April 26, 2012 12:38 PM
  • I've pinged him.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Thursday, April 26, 2012 1:20 PM