summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Pages/StringJsonSource.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Pages/StringJsonSource.cs')
-rw-r--r--Xamarin.Forms.Pages/StringJsonSource.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Xamarin.Forms.Pages/StringJsonSource.cs b/Xamarin.Forms.Pages/StringJsonSource.cs
new file mode 100644
index 00000000..79e59e62
--- /dev/null
+++ b/Xamarin.Forms.Pages/StringJsonSource.cs
@@ -0,0 +1,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);
+ }
+ }
+} \ No newline at end of file