diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Android/LayoutExtensions.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Android/LayoutExtensions.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/LayoutExtensions.cs b/Xamarin.Forms.Platform.Android/LayoutExtensions.cs new file mode 100644 index 00000000..90427b61 --- /dev/null +++ b/Xamarin.Forms.Platform.Android/LayoutExtensions.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using AView = Android.Views.View; + +namespace Xamarin.Forms.Platform.Android +{ + public static class LayoutExtensions + { + public static void Add(this IList<View> children, AView view, GetDesiredSizeDelegate getDesiredSizeDelegate = null, OnLayoutDelegate onLayoutDelegate = null, + OnMeasureDelegate onMeasureDelegate = null) + { + children.Add(view.ToView(getDesiredSizeDelegate, onLayoutDelegate, onMeasureDelegate)); + } + + public static View ToView(this AView view, GetDesiredSizeDelegate getDesiredSizeDelegate = null, OnLayoutDelegate onLayoutDelegate = null, OnMeasureDelegate onMeasureDelegate = null) + { + return new NativeViewWrapper(view, getDesiredSizeDelegate, onLayoutDelegate, onMeasureDelegate); + } + } +}
\ No newline at end of file |