summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs')
-rw-r--r--Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs b/Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs
new file mode 100644
index 00000000..209aca80
--- /dev/null
+++ b/Xamarin.Forms.Platform.iOS/NativeViewWrapper.cs
@@ -0,0 +1,35 @@
+using System.Collections.Generic;
+#if __UNIFIED__
+using CoreGraphics;
+using UIKit;
+
+#else
+using MonoTouch.UIKit;
+#endif
+
+#if !__UNIFIED__
+ // Save ourselves a ton of ugly ifdefs below
+using CGSize = System.Drawing.SizeF;
+#endif
+
+namespace Xamarin.Forms.Platform.iOS
+{
+ public class NativeViewWrapper : View
+ {
+ public NativeViewWrapper(UIView nativeView, GetDesiredSizeDelegate getDesiredSizeDelegate = null, SizeThatFitsDelegate sizeThatFitsDelegate = null, LayoutSubviewsDelegate layoutSubViews = null)
+ {
+ GetDesiredSizeDelegate = getDesiredSizeDelegate;
+ SizeThatFitsDelegate = sizeThatFitsDelegate;
+ LayoutSubViews = layoutSubViews;
+ NativeView = nativeView;
+ }
+
+ public GetDesiredSizeDelegate GetDesiredSizeDelegate { get; }
+
+ public LayoutSubviewsDelegate LayoutSubViews { get; set; }
+
+ public UIView NativeView { get; }
+
+ public SizeThatFitsDelegate SizeThatFitsDelegate { get; set; }
+ }
+} \ No newline at end of file