diff options
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs b/Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs index 50bba17f..3b3ef91b 100644 --- a/Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs +++ b/Xamarin.Forms.Platform.iOS/ExportRendererAttribute.cs @@ -1,29 +1,37 @@ using System; + +#if __MOBILE__ using UIKit; +#endif namespace Xamarin.Forms { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public sealed class ExportRendererAttribute : HandlerAttribute { +#if __MOBILE__ public ExportRendererAttribute(Type handler, Type target, UIUserInterfaceIdiom idiom) : base(handler, target) { Idiomatic = true; Idiom = idiom; } + internal UIUserInterfaceIdiom Idiom { get; } +#endif public ExportRendererAttribute(Type handler, Type target) : base(handler, target) { Idiomatic = false; } - internal UIUserInterfaceIdiom Idiom { get; } - internal bool Idiomatic { get; } public override bool ShouldRegister() { +#if __MOBILE__ return !Idiomatic || Idiom == UIDevice.CurrentDevice.UserInterfaceIdiom; +#else + return !Idiomatic; +#endif } } }
\ No newline at end of file |