diff options
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs b/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs index 9e20e045..acdd6523 100644 --- a/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs +++ b/Xamarin.Forms.Platform.iOS/NativeValueConverterService.cs @@ -1,16 +1,23 @@ using System; +#if __MOBILE__ using UIKit; - [assembly: Xamarin.Forms.Dependency(typeof(Xamarin.Forms.Platform.iOS.NativeValueConverterService))] - namespace Xamarin.Forms.Platform.iOS +#else +using UIView = AppKit.NSView; + +[assembly: Xamarin.Forms.Dependency(typeof(Xamarin.Forms.Platform.MacOS.NativeValueConverterService))] + +namespace Xamarin.Forms.Platform.MacOS +#endif { 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))) { + if (typeof(UIView).IsInstanceOfType(value) && toType.IsAssignableFrom(typeof(View))) + { nativeValue = ((UIView)value).ToView(); return true; } |