Remove unnecessaray parameter of TizenDeviceInfo
[platform/upstream/xamarin-forms.git] / Xamarin.Forms.Pages / UriJsonSource.cs
1 using System;
2 using System.IO;
3 using System.Net;
4 using System.Net.Http;
5 using System.Threading.Tasks;
6
7 namespace Xamarin.Forms.Pages
8 {
9         public class UriJsonSource : JsonSource
10         {
11                 public static readonly BindableProperty UriProperty = BindableProperty.Create(nameof(Uri), typeof(Uri),
12                         typeof(UriJsonSource), null);
13
14                 [TypeConverter(typeof(UriTypeConverter))]
15                 public Uri Uri
16                 {
17                         get { return (Uri)GetValue(UriProperty); }
18                         set { SetValue(UriProperty, value); }
19                 }
20
21                 public override async Task<string> GetJson()
22                 {
23                         var webClient = new HttpClient();
24                         try
25                         {
26                                 string json = await webClient.GetStringAsync(Uri);
27                                 return json;
28                         }
29                         catch
30                         {
31                                 return null;
32                         }
33                 }
34         }
35 }