Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public sealed partial class MainPage : Page
- {
- public MainPage()
- {
- this.InitializeComponent();
- Loaded += MainPage_Loaded;
- }
- async void MainPage_Loaded(object sender, RoutedEventArgs e)
- {
- HttpClient client = new HttpClient();
- string result = await client.GetStringAsync(
- new Uri("http://www.colourlovers.com/api/patterns/top?numResults=6&format=json"));
- this.patterns.Source = JArray.Parse(result).ToObject<List<Pattern>>();
- string result2 = await client.GetStringAsync(
- new Uri("http://www.colourlovers.com/api/palettes/top?numResults=6&format=json"));
- this.palettes.Source = JArray.Parse(result2).ToObject<List<Pattern>>();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement