summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/WebViewSource.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Core/WebViewSource.cs')
-rw-r--r--Xamarin.Forms.Core/WebViewSource.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/WebViewSource.cs b/Xamarin.Forms.Core/WebViewSource.cs
new file mode 100644
index 00000000..6dc2635f
--- /dev/null
+++ b/Xamarin.Forms.Core/WebViewSource.cs
@@ -0,0 +1,28 @@
+using System;
+
+namespace Xamarin.Forms
+{
+ public abstract class WebViewSource : BindableObject
+ {
+ public static implicit operator WebViewSource(Uri url)
+ {
+ return new UrlWebViewSource { Url = url?.AbsoluteUri };
+ }
+
+ public static implicit operator WebViewSource(string url)
+ {
+ return new UrlWebViewSource { Url = url };
+ }
+
+ protected void OnSourceChanged()
+ {
+ EventHandler eh = SourceChanged;
+ if (eh != null)
+ eh(this, EventArgs.Empty);
+ }
+
+ internal abstract void Load(IWebViewRenderer renderer);
+
+ internal event EventHandler SourceChanged;
+ }
+} \ No newline at end of file