diff options
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs b/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs new file mode 100644 index 00000000..9e20e045 --- /dev/null +++ b/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs @@ -0,0 +1,20 @@ +using System; +using UIKit; + +[assembly: Xamarin.Forms.Dependency(typeof(Xamarin.Forms.Platform.iOS.NativeValueConverterService))] + +namespace Xamarin.Forms.Platform.iOS +{ + class NativeValueConverterService : Xaml.INativeValueConverterService + { + public bool ConvertTo(object value, Type toType, out object nativeValue) + { + nativeValue = null; + if (typeof(UIView).IsInstanceOfType(value) && toType.IsAssignableFrom(typeof(View))) { + nativeValue = ((UIView)value).ToView(); + return true; + } + return false; + } + } +}
\ No newline at end of file |