Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Navigation;
- using Microsoft.Phone.Controls;
- using Microsoft.Phone.Shell;
- using PhoneApp5.Resources;
- using Newtonsoft.Json;
- namespace PhoneApp5
- {
- public partial class MainPage : PhoneApplicationPage
- {
- // Constructor
- public MainPage()
- {
- InitializeComponent();
- var definition1 = new { Name = "" };
- var definition2 = new { id = "" }; //is that true? i want to pull inside the Table1
- string json1 = @"{'Name':'James'}";
- string json2 = @"{
- 'Table1': [
- {
- 'id': 0,
- 'item': 'item 0'
- },
- {
- 'id': 1,
- 'item': 'item 1'
- }
- ]
- }";
- var example1 = JsonConvert.DeserializeAnonymousType(json1, definition1);
- var example2 = JsonConvert.DeserializeAnonymousType(json2, definition2);
- MessageBox.Show(example2.id);
- // ??? i need to do with a long list selector
- }
- }
- }
- public class MyClass
- {
- public string Id { get; set; }
- public string Item { get; set; }
- }
- var myClassList = JsonConvert.DeserializeObject<List<MyClass>>(e.Result);
- longListSelector.ItemsSource = myClassList;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement