summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Pages/StringJsonSource.cs
blob: 79e59e621dad8ac622c0e828f090582ff642aa61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Threading.Tasks;

namespace Xamarin.Forms.Pages
{
	public class StringJsonSource : JsonSource
	{
		public static readonly BindableProperty JsonProperty = BindableProperty.Create(nameof(Json), typeof(string), typeof(StringJsonSource), null);

		public string Json
		{
			get { return (string)GetValue(JsonProperty); }
			set { SetValue(JsonProperty, value); }
		}

		public override Task<string> GetJson()
		{
			return Task.FromResult(Json);
		}
	}
}