locked
working with json

    Question

  • here is part of my JSON:

                        

    {"Groups":[
      {
        "UniqueId": "Group-1",
        "Title": "Appetizers",
        "Subtitle": "Group subtitle: 1",
        "ImagePath": "Assets/DarkGray.png",
        "Description" : "Group Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor scelerisque lorem in vehicula. Aliquam tincidunt, lacus ut sagittis tristique, turpis massa volutpat augue, eu rutrum ligula ante a ante",
        "Items":
        [
          {
            "UniqueId": "Group-1-Item-1",
            "Title": "Best Grape Salad",
            "Subtitle": "Item Subtitle: 1",
            "ImagePath": "Assets/Bev.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" :  ""

          },
          {
            "UniqueId": "Group-1-Item-2",
            "Title": "Cran Berry Feta Pinwheels",
            "Subtitle": "Item Subtitle: 2",
            "ImagePath": "Assets/baby kato.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ",
            "Content" :["Cran Berry Feta Pinwheels", 
                        "1 (170 g) package dried sweetened cranberries",
                        "1 (250 g) container cream cheese spread",
                        "1 cup crumbled feta cheese",
                        "1/4 cup chopped green onion",
                        "4 large flour tortillas or 4 large wheat flour tortillas or 4 large spinach tortillas"


            ] 



          },

    i have only edited the content section and added images and titles. Everytime i run the application i get this exception:

    An exception of type 'System.InvalidOperationException' occurred in mscorlib.ni.dll but was not handled in user code

    WinRT information: This is not a string value. Use ValueType property to get the type.

    Additional information: A method was called at an unexpected time.

    It then highlights this line of code:

     var sampleDataGroups = await SampleDataSource.GetGroupsAsync();

    If i work with the default contents of JSON it works well but if i edit it brings an error.

    i am an absolute beginner

    Tuesday, July 15, 2014 9:06 AM

All replies

  • It will not be possible to help you in absence of code you have. You can put  that on onedrive and post a link here.

    -- Vishal Kaushik --

    Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you. Happy Coding!!!

    Tuesday, July 15, 2014 10:15 AM
  • you json isn't valid. althought it could be you didn't post the whole json file

    Your first item object has no content, the second one has an array of strings but at the end there are some missing brackets

    but like Vishal said it hard to say without the code if there are any more defects


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Tuesday, July 15, 2014 11:34 AM
  • {"Groups":[
      {
        "UniqueId": "Group-1",
        "Title": "Appetizers",
        "Subtitle": "Group subtitle: 1",
        "ImagePath": "Assets/DarkGray.png",
        "Description" : "Group Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor scelerisque lorem in vehicula. Aliquam tincidunt, lacus ut sagittis tristique, turpis massa volutpat augue, eu rutrum ligula ante a ante",
        "Items":
        [
          {
            "UniqueId": "Group-1-Item-1",
            "Title": "Best Grape Salad",
            "Subtitle": "Item Subtitle: 1",
            "ImagePath": "Assets/Bev.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" :  ""

          },
          {
            "UniqueId": "Group-1-Item-2",
            "Title": "Cran Berry Feta Pinwheels",
            "Subtitle": "Item Subtitle: 2",
            "ImagePath": "Assets/baby kato.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" :["Cran Berry Feta Pinwheels", 
                        "1 (170 g) package dried sweetened cranberries",
                        "1 (250 g) container cream cheese spread",
                        "1 cup crumbled feta cheese",
                        "1/4 cup chopped green onion",
                        "4 large flour tortillas or 4 large wheat flour tortillas or 4 large spinach tortillas"


            ] 



          },
          {
            "UniqueId": "Group-1-Item-3",
            "Title": "Kittencals Chinese Chicken Balls with Sour and Sweet Source",
            "Subtitle": "Item Subtitle: 3",
            "ImagePath": "Assets/linajiac.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-1-Item-4",
            "Title": "Lucky Sweet and Sour Source",
            "Subtitle": "Item Subtitle: 4",
            "ImagePath": "Assets/neondo.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : "Ingredients:  1/4 cup ketchup 1/4 cup sugar 1/4 cup vinegar 1 tablespoon soy sauce 1 1/2 tablespoons cornstarch 3/4 cup pineapple juice (I use pineapple juice) or 3/4 cup water (I use pineapple juice) 2 teaspoons oil Directions: 1 Mix juice and cornstarch. 2 Heat oil in a small saucepan and add remaining ingredients and cornstarch mixture. 3 Cook over medium to medium high heat, stirring until sauce thickens."
          },
          {
            "UniqueId": "Group-1-Item-5",
            "Title": "TSR Version of Carrabba's Bread Dipping Spice by Todd Wilbur",
            "Subtitle": "Item Subtitle: 5",
            "ImagePath": "Assets/pic1.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : "Ingredients 1  tablespoon  minced basil  1  tablespoon  chopped parsley (Italian is best) 1  tablespoon  minced garlic 1  teaspoon dried thyme 1  teaspoon dried oregano  1  teaspoon ground black pepper 1/2 teaspoon kosher salt or 1/2 teaspoon  ground sea salt 1/2 teaspoon  chopped rosemary 1/4 teaspoon crushed red pepper flakes 1/2 teaspoon olive oil 1/8 teaspoon fresh lemon juice Directions: 1 Combine all of the ingredients, EXCEPT oil and lemon. 2 Put in a small food processor (I used my little food chopper). Chop briefly until all ingredients are about the same. 3 Stir in oil and lemon juice. 4 TO SERVE: Combine about 1 1/2 teaspoons spice blend to 3 to 4 tablespoons olive oil on a small Dish. 5 Dip sliced bread in mixture. 6 French bread is good. 7 ENJOY."
          }

        ]
      },
      {
        "UniqueId": "Group-2",
        "Title": " Beverages",
        "Subtitle": "Group subtitle: 2",
        "ImagePath": "Assets/LightGray.png",
        "Description" : "Group Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor scelerisque lorem in vehicula. Aliquam tincidunt, lacus ut sagittis tristique, turpis massa volutpat augue, eu rutrum ligula ante a ante",
        "Items":
        [
          {
            "UniqueId": "Group-2-Item-1",
            "Title": "Ice Cubes",
            "Subtitle": "Item Subtitle: 1",
            "ImagePath": "Assets/fridge.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-2-Item-2",
            "Title": "Iced Coffee",
            "Subtitle": "Item Subtitle: 2",
            "ImagePath": "Assets/coffee.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-2-Item-3",
            "Title": "Southern Sweet Iced Tea",
            "Subtitle": "Item Subtitle: 3",
            "ImagePath": "Assets/Tea.jpg",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          }
        ]
      },
      {
        "UniqueId": "Group-3",
        "Title": "Group Title: 3",
        "Subtitle": "Group subtitle: 3",
        "ImagePath": "Assets/MediumGray.png",
        "Description" : "Group Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor scelerisque lorem in vehicula. Aliquam tincidunt, lacus ut sagittis tristique, turpis massa volutpat augue, eu rutrum ligula ante a ante",
        "Items":
        [
          {
            "UniqueId": "Group-3-Item-1",
            "Title": "Item Title: 1",
            "Subtitle": "Item Subtitle: 1",
            "ImagePath": "Assets/MediumGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-3-Item-2",
            "Title": "Item Title: 2",
            "Subtitle": "Item Subtitle: 2",
            "ImagePath": "Assets/MediumGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-3-Item-3",
            "Title": "Item Title: 3",
            "Subtitle": "Item Subtitle: 3",
            "ImagePath": "Assets/LightGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-3-Item-4",
            "Title": "Item Title: 4",
            "Subtitle": "Item Subtitle: 4",
            "ImagePath": "Assets/DarkGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-3-Item-5",
            "Title": "Item Title: 5",
            "Subtitle": "Item Subtitle: 5",
            "ImagePath": "Assets/LightGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-3-Item-6",
            "Title": "Item Title: 6",
            "Subtitle": "Item Subtitle: 6",
            "ImagePath": "Assets/DarkGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-3-Item-7",
            "Title": "Item Title: 7",
            "Subtitle": "Item Subtitle: 7",
            "ImagePath": "Assets/MediumGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          }
        ]
      },
      {
        "UniqueId": "Group-4",
        "Title": "Group Title: 4",
        "Subtitle": "Group subtitle: 4",
        "ImagePath": "Assets/MediumGray.png",
        "Description" : "Group Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor scelerisque lorem in vehicula. Aliquam tincidunt, lacus ut sagittis tristique, turpis massa volutpat augue, eu rutrum ligula ante a ante",
        "Items":
        [
          {
            "UniqueId": "Group-4-Item-1",
            "Title": "Item Title: 1",
            "Subtitle": "Item Subtitle: 1",
            "ImagePath": "Assets/MediumGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-4-Item-2",
            "Title": "Item Title: 2",
            "Subtitle": "Item Subtitle: 2",
            "ImagePath": "Assets/MediumGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-4-Item-3",
            "Title": "Item Title: 3",
            "Subtitle": "Item Subtitle: 3",
            "ImagePath": "Assets/LightGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-4-Item-4",
            "Title": "Item Title: 4",
            "Subtitle": "Item Subtitle: 4",
            "ImagePath": "Assets/DarkGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-4-Item-5",
            "Title": "Item Title: 5",
            "Subtitle": "Item Subtitle: 5",
            "ImagePath": "Assets/LightGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-4-Item-6",
            "Title": "Item Title: 6",
            "Subtitle": "Item Subtitle: 6",
            "ImagePath": "Assets/DarkGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          }
        ]
      },
      {
        "UniqueId": "Group-5",
        "Title": "Group Title: 5",
        "Subtitle": "Group subtitle: 5",
        "ImagePath": "Assets/MediumGray.png",
        "Description" : "Group Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor scelerisque lorem in vehicula. Aliquam tincidunt, lacus ut sagittis tristique, turpis massa volutpat augue, eu rutrum ligula ante a ante",
        "Items":
        [
          {
            "UniqueId": "Group-5-Item-1",
            "Title": "Item Title: 1",
            "Subtitle": "Item Subtitle: 1",
            "ImagePath": "Assets/MediumGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-5-Item-2",
            "Title": "Item Title: 2",
            "Subtitle": "Item Subtitle: 2",
            "ImagePath": "Assets/MediumGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-5-Item-3",
            "Title": "Item Title: 3",
            "Subtitle": "Item Subtitle: 3",
            "ImagePath": "Assets/LightGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-5-Item-4",
            "Title": "Item Title: 4",
            "Subtitle": "Item Subtitle: 4",
            "ImagePath": "Assets/DarkGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          }
        ]
      },
      {
        "UniqueId": "Group-6",
        "Title": "Group Title: 6",
        "Subtitle": "Group subtitle: 6",
        "ImagePath": "Assets/MediumGray.png",
        "Description" : "Group Description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus tempor scelerisque lorem in vehicula. Aliquam tincidunt, lacus ut sagittis tristique, turpis massa volutpat augue, eu rutrum ligula ante a ante",
        "Items":
        [
          {
            "UniqueId": "Group-6-Item-1",
            "Title": "Item Title: 1",
            "Subtitle": "Item Subtitle: 1",
            "ImagePath": "Assets/MediumGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-6-Item-2",
            "Title": "Item Title: 2",
            "Subtitle": "Item Subtitle: 2",
            "ImagePath": "Assets/MediumGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-6-Item-3",
            "Title": "Item Title: 3",
            "Subtitle": "Item Subtitle: 3",
            "ImagePath": "Assets/LightGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-6-Item-4",
            "Title": "Item Title: 4",
            "Subtitle": "Item Subtitle: 4",
            "ImagePath": "Assets/DarkGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-6-Item-5",
            "Title": "Item Title: 5",
            "Subtitle": "Item Subtitle: 5",
            "ImagePath": "Assets/LightGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-6-Item-6",
            "Title": "Item Title: 6",
            "Subtitle": "Item Subtitle: 6",
            "ImagePath": "Assets/DarkGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-6-Item-7",
            "Title": "Item Title: 7",
            "Subtitle": "Item Subtitle: 7",
            "ImagePath": "Assets/DarkGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          },
          {
            "UniqueId": "Group-6-Item-8",
            "Title": "Item Title: 8",
            "Subtitle": "Item Subtitle: 8",
            "ImagePath": "Assets/DarkGray.png",
            "Description" : "Item Description: Pellentesque porta, mauris quis interdum vehicula, urna sapien ultrices velit, nec venenatis dui odio in augue. Cras posuere, enim a cursus convallis, neque turpis malesuada erat, ut adipiscing neque tortor ac erat.",
            "Content" : ""
          }
        ]
      }
    ]
    }

    here is the whole JSON file as it comes when creating a hubApp Template i removed some items in content as you can see because i want to test if the second one with array of strings if it will work

    public class SampleDataGroup
        {
            public SampleDataGroup(String uniqueId, String title, String subtitle, String imagePath, String description)
            {
                this.UniqueId = uniqueId;
                this.Title = title;
                this.Subtitle = subtitle;
                this.Description = description;
                this.ImagePath = imagePath;
                this.Items = new ObservableCollection<SampleDataItem>();
            }

            public string UniqueId { get; private set; }
            public string Title { get; private set; }
            public string Subtitle { get; private set; }
            public string Description { get; private set; }
            public string ImagePath { get; private set; }
            public ObservableCollection<SampleDataItem> Items { get; private set; }

            public override string ToString()
            {
                return this.Title;
            }
        }

    that above is my sample data group

    it highlights the code below as an error

     var sampleDataGroups = await SampleDataSource.GetGroupsAsync(); 

    under itemPage.xaml i have used the following code to bind to the data in JSON

    <Grid Grid.Row="1" x:Name="ContentRoot">
                <StackPanel>
                    <Image Source="{Binding ImagePath}" 
                       Margin="0,12,0,0"
                       Height="200" 
                        Stretch="UniformToFill" />

                    <TextBlock Text="{Binding Content}" 
                           Margin="10,12,10,0" 
                           TextWrapping="Wrap" 
                           FontSize="20" />
                </StackPanel>

    but in itemPage.xaml the following code has been highlighted as an error

    d:DataContext="{Binding Groups[0].Items[0], Source={d:DesignData Source=/DataModel/SampleData.json, Type=data:SampleDataSource}}"

                               
    Tuesday, July 15, 2014 3:45 PM