5 using System.Threading.Tasks;
7 namespace Xamarin.Forms.Pages
9 public class UriJsonSource : JsonSource
11 public static readonly BindableProperty UriProperty = BindableProperty.Create(nameof(Uri), typeof(Uri),
12 typeof(UriJsonSource), null);
14 [TypeConverter(typeof(UriTypeConverter))]
17 get { return (Uri)GetValue(UriProperty); }
18 set { SetValue(UriProperty, value); }
21 public override async Task<string> GetJson()
23 var webClient = new HttpClient();
26 string json = await webClient.GetStringAsync(Uri);