summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/NativeValueConverterService.cs
blob: ff6faa90add711f6aecd7e419db14eb3419b36f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
´╗┐using System;
using AView = Android.Views.View;

[assembly: Xamarin.Forms.Dependency(typeof(Xamarin.Forms.Platform.Android.NativeValueConverterService))]
namespace Xamarin.Forms.Platform.Android
{
	class NativeValueConverterService : Xaml.INativeValueConverterService
	{
		public bool ConvertTo(object value, Type toType, out object nativeValue)
		{
			nativeValue = null;
			if (typeof(AView).IsInstanceOfType(value) && toType.IsAssignableFrom(typeof(View))) {
				nativeValue = ((AView)value).ToView();
				return true;
			}
			return false;
		}
	}
}