diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Android/NativeValueConverterService.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Android/NativeValueConverterService.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/NativeValueConverterService.cs b/Xamarin.Forms.Platform.Android/NativeValueConverterService.cs new file mode 100644 index 00000000..ff6faa90 --- /dev/null +++ b/Xamarin.Forms.Platform.Android/NativeValueConverterService.cs @@ -0,0 +1,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; + } + } +}
\ No newline at end of file |