Advertisement
sorskoot

Hub control demo1 codebehind

Jul 1st, 2013
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1.   public sealed partial class MainPage : Page
  2.     {
  3.         public MainPage()
  4.         {
  5.             this.InitializeComponent();
  6.             Loaded += MainPage_Loaded;
  7.         }
  8.  
  9.         async void MainPage_Loaded(object sender, RoutedEventArgs e)
  10.         {
  11.             HttpClient client = new HttpClient();
  12.             string result = await client.GetStringAsync(
  13.                 new Uri("http://www.colourlovers.com/api/patterns/top?numResults=6&format=json"));
  14.             this.patterns.Source = JArray.Parse(result).ToObject<List<Pattern>>();
  15.  
  16.             string result2 = await client.GetStringAsync(
  17.                 new Uri("http://www.colourlovers.com/api/palettes/top?numResults=6&format=json"));
  18.             this.palettes.Source = JArray.Parse(result2).ToObject<List<Pattern>>();
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement