summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/WebViewSourceTypeConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core/WebViewSourceTypeConverter.cs')
-rw-r--r--Xamarin.Forms.Core/WebViewSourceTypeConverter.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/WebViewSourceTypeConverter.cs b/Xamarin.Forms.Core/WebViewSourceTypeConverter.cs
new file mode 100644
index 00000000..5955eb14
--- /dev/null
+++ b/Xamarin.Forms.Core/WebViewSourceTypeConverter.cs
@@ -0,0 +1,15 @@
+using System;
+
+namespace Xamarin.Forms
+{
+ public class WebViewSourceTypeConverter : TypeConverter
+ {
+ public override object ConvertFromInvariantString(string value)
+ {
+ if (value != null)
+ return new UrlWebViewSource { Url = value };
+
+ throw new InvalidOperationException(string.Format("Cannot convert \"{0}\" into {1}", value, typeof(Color)));
+ }
+ }
+} \ No newline at end of file