summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/WebViewSource.cs
blob: 7b4c1bf7e21f802116ef1fc77b1db532218bf2af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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(IWebViewDelegate renderer);

		internal event EventHandler SourceChanged;
	}
}