// Parent has imposed a maximum size on us
                case MeasureSpecification.ModeType.AtMost:
                {
                    if (childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent)
                    {
                        // Crashed. Cannot calculate. 

                        // Child wants to be our size, but our size is not fixed.
                        // Constrain child to not be bigger than us.
                        resultMode = MeasureSpecification.ModeType.AtMost;
                    }
                    else if (childDimension.AsRoundedValue() == LayoutParamPolicies.WrapContent)
                    {
                        // Child wants to determine its own size. It can't be
                        // bigger than us.

                        // Don't need parent's size. Size of this child will be determined by its children.
                        resultMode = MeasureSpecification.ModeType.AtMost;
                    }
                    else
                    {
                        // Child wants a specific size... so be it
                        resultSize = childDimension;
                        resultMode = MeasureSpecification.ModeType.Exactly;
                    }

                    break;
                }

                // Parent asked to see how big we want to be
                case MeasureSpecification.ModeType.Unspecified:
                {
                    if ((childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent))
                    {
                        // Child wants to be our size... find out how big it should be

                        // There is no one who has exact size in parent hierarchy.
                        // Cannot calculate.
                        resultMode = MeasureSpecification.ModeType.Unspecified;
                    }
                    else if (childDimension.AsRoundedValue() == (LayoutParamPolicies.WrapContent))
                    {
                        // Child wants to determine its own size.... find out how big
                        // it should be
                        resultMode = MeasureSpecification.ModeType.Unspecified;
                    }
                    else
                    {
                        // Child wants a specific size... let him have it
                        resultSize = childDimension;
                        resultMode = MeasureSpecification.ModeType.Exactly;
                    }
                    break;
                }
            } // switch

            return new MeasureSpecification( resultSize, resultMode );
        }

        /// <summary>
        /// Measure the layout and its content to determine the measured width and the measured height.<br />
        /// If this method is overridden, it is the subclass's responsibility to make
        /// sure the measured height and width are at least the layout's minimum height
        /// and width. <br />
        /// </summary>
        /// <param name="widthMeasureSpec">horizontal space requirements as imposed by the parent.</param>
        /// <param name="heightMeasureSpec">vertical space requirements as imposed by the parent.</param>
        /// <since_tizen> 6 </since_tizen>
        protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
        {
            LayoutLength measuredWidth = new LayoutLength(0.0f);
            LayoutLength measuredHeight = new LayoutLength(0.0f);

            // Layout takes size of largest child width and largest child height dimensions
            foreach( LayoutItem childLayout in LayoutChildren )
            {
                if( childLayout!= null )
                {
                    MeasureChild( childLayout, widthMeasureSpec, heightMeasureSpec );
                    LayoutLength childWidth = new LayoutLength(childLayout.MeasuredWidth.Size);
                    LayoutLength childHeight = new LayoutLength( childLayout.MeasuredHeight.Size);

                    Extents childMargin = childLayout.Margin;
                    measuredWidth = new LayoutLength(Math.Max( measuredWidth.AsDecimal(), childWidth.AsDecimal() + childMargin.Start + childMargin.End));
                    measuredHeight = new LayoutLength(Math.Max( measuredHeight.AsDecimal(), childHeight.AsDecimal() + childMargin.Top + childMargin.Bottom));
                }
            }

            if( 0 == LayoutChildren.Count )
            {
                // Must be a leaf as has no children
                measuredWidth = GetDefaultSize( SuggestedMinimumWidth, widthMeasureSpec );
                measuredHeight = GetDefaultSize( SuggestedMinimumHeight, heightMeasureSpec );
            }

            SetMeasuredDimensions( new MeasuredSize( measuredWidth, MeasuredSize.StateType.MeasuredSizeOK ),
                                   new MeasuredSize( measuredHeight, MeasuredSize.StateType.MeasuredSizeOK ) );
        }

        /// <summary>
        /// Called from Layout() when this layout should assign a size and position to each of its children.<br />
        /// Derived classes with children should override this method and call Layout() on each of their children.<br />
        /// </summary>
        /// <param name="changed">This is a new size or position for this layout.</param>
        /// <param name="left">Left position, relative to parent.</param>
        /// <param name="top"> Top position, relative to parent.</param>
        /// <param name="right">Right position, relative to parent.</param>
        /// <param name="bottom">Bottom position, relative to parent.</param>
        /// <since_tizen> 6 </since_tizen>
        protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
        {
            foreach( LayoutItem childLayout in LayoutChildren )
            {
                if( childLayout!=null )
                {
                    // Use position if explicitly set to child otherwise will be top left.
                    var childLeft = new LayoutLength( childLayout.Owner.Position2D.X );
                    var childTop = new LayoutLength( childLayout.Owner.Position2D.Y );

                    View owner = Owner;

                    if ( owner )
                    {
                        // Margin and Padding only supported when child anchor point is TOP_LEFT.
                        if ( owner.PivotPoint == PivotPoint.TopLeft || ( owner.PositionUsesPivotPoint == false ) )
                        {
                            childLeft = childLeft + owner.Padding.Start + childLayout.Margin.Start;
                            childTop = childTop + owner.Padding.Top + childLayout.Margin.Top;
                        }
                    }
                    childLayout.Layout( childLeft, childTop, childLeft + childLayout.MeasuredWidth.Size, childTop + childLayout.MeasuredHeight.Size );
                }
            }
        }

        /// <summary>
        /// Overridden method called when the layout is attached to an owner.<br />
        /// </summary>
        /// <since_tizen> 6 </since_tizen>
        protected override void OnAttachedToOwner()
        {
            // Layout takes ownership of it's owner's children.
            foreach (View view in Owner.Children)
            {
                AddChildToLayoutGroup(view);
            }

            // Connect to owner ChildAdded signal.
            Owner.ChildAdded += OnChildAddedToOwner;

            // Removing Child from the owners View will directly call the LayoutGroup removal API.
        }

        // Virtual Methods that can be overridden by derived classes.

        /// <summary>
        /// Callback when child is added to container.<br />
        /// Derived classes can use this to set their own child properties on the child layout's owner.<br />
        /// </summary>
        /// <param name="child">The Layout child.</param>
        /// <since_tizen> 6 </since_tizen>
        protected virtual void OnChildAdd(LayoutItem child)
        {
        }

        /// <summary>
        /// Callback when child is removed from container.<br />
        /// </summary>
        /// <param name="child">The Layout child.</param>
        /// <since_tizen> 6 </since_tizen>
        protected virtual void OnChildRemove(LayoutItem child)
        {
        }

        /// <summary>
        /// Ask all of the children of this view to measure themselves, taking into
        /// account both the MeasureSpec requirements for this view and its padding.<br />
        /// The heavy lifting is done in GetChildMeasureSpec.<br />
        /// </summary>
        /// <param name="widthMeasureSpec">The width requirements for this view.</param>
        /// <param name="heightMeasureSpec">The height requirements for this view.</param>
        /// <since_tizen> 6 </since_tizen>
        protected virtual void MeasureChildren(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
        {
            foreach( LayoutItem childLayout in LayoutChildren )
            {
                MeasureChild( childLayout, widthMeasureSpec, heightMeasureSpec );
            }
        }

        /// <summary>
        /// Ask one of the children of this view to measure itself, taking into
        /// account both the MeasureSpec requirements for this view and its padding.<br />
        /// The heavy lifting is done in GetChildMeasureSpecification.<br />
        /// </summary>
        /// <param