[NUI][API8] Add Constraint base + inhouse ResizePolicyType.KeepSizeFollowingParent...
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
index a319f4f..076db39 100755 (executable)
@@ -19,6 +19,7 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
 using Tizen.NUI.Binding;
+using Tizen.NUI.Components;
 
 namespace Tizen.NUI.BaseComponents
 {
@@ -44,19 +45,47 @@ namespace Tizen.NUI.BaseComponents
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static bool layoutingDisabled{get; set;} = true;
 
-        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
         private LayoutItem _layout; // Exclusive layout assigned to this View.
 
         // List of transitions paired with the condition that uses the transition.
         private Dictionary<TransitionCondition, TransitionList> _layoutTransitions;
         private int _widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
         private int _heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
+        private int _oldWidthPolicy = LayoutParamPolicies.MatchParent; // // Store Layout width to compare against later
+        private int _oldHeightPolicy = LayoutParamPolicies.MatchParent; // Store Layout height to compare against later
         private float _weight = 0.0f; // Weighting of child View in a Layout
         private MeasureSpecification _measureSpecificationWidth; // Layout width and internal Mode
         private MeasureSpecification _measureSpecificationHeight; // Layout height and internal Mode
         private bool _backgroundImageSynchronosLoading = false;
         private Dictionary<string, Transition> transDictionary = new Dictionary<string, Transition>();
         private string[] transitionNames;
+        private bool controlStatePropagation = false;
+        private ViewStyle viewStyle;
+        private bool themeChangeSensitive = false;
+
+        internal Size2D sizeSetExplicitly = new Size2D(); // Store size set by API, will be used in place of NaturalSize if not set.
+        internal BackgroundExtraData backgroundExtraData;
+
+        // List of constraint
+        private Constraint widthConstraint = null;
+        private Constraint heightConstraint = null;
+
+        static View() {}
+
+        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ViewStyle ViewStyle
+        {
+            get
+            {
+                if (null == viewStyle)
+                {
+                    ApplyStyle(GetViewStyle());
+                }
+
+                return viewStyle;
+            }
+        }
 
         /// <summary>
         /// Creates a new instance of a view.
@@ -67,6 +96,12 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public View(ViewStyle viewStyle) : this(Interop.View.View_New(), true, viewStyle)
+        {
+        }
+
         /// <summary>
         /// Create a new instance of a View with setting the status of shown or hidden.
         /// </summary>
@@ -86,11 +121,20 @@ namespace Tizen.NUI.BaseComponents
             {
                 SetVisible(false);
             }
+
+            backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
+        }
+
+        internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
+        {
+            if (!ThemeManager.ThemeApplied) return;
+
+            if (viewStyle == null) UpdateStyle(); // Use style in the current theme
+            else ApplyStyle(viewStyle.Clone());   // Use given style
         }
 
         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn)
         {
-            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
             if (HasBody())
             {
                 PositionUsesPivotPoint = false;
@@ -115,6 +159,55 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
+        /// <summary>
+        /// The event that is triggered when the View's ControlState is changed.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
+
+        internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
+
+        private ControlState controlStates = ControlState.Normal;
+        /// <summary>
+        /// Get/Set the control state.
+        /// </summary>
+        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ControlState ControlState
+        {
+            get
+            {
+                return controlStates;
+            }
+            protected set
+            {
+                if (controlStates == value)
+                {
+                    return;
+                }
+
+                var prevState = controlStates;
+
+                controlStates = value;
+
+                var changeInfo = new ControlStateChangedEventArgs(prevState, value);
+
+                ControlStateChangeEventInternal?.Invoke(this, changeInfo);
+
+                if (controlStatePropagation)
+                {
+                    foreach (View child in Children)
+                    {
+                        child.ControlState = value;
+                    }
+                }
+
+                OnControlStateChanged(changeInfo);
+
+                ControlStateChangedEvent?.Invoke(this, changeInfo);
+            }
+        }
+
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public bool IsResourcesCreated
@@ -141,6 +234,7 @@ namespace Tizen.NUI.BaseComponents
 
         /// <summary>
         /// The StyleName, type string.
+        /// The value indicates DALi style name defined in json theme file.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
         public string StyleName
@@ -157,18 +251,44 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// The KeyInputFocus, type bool.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool KeyInputFocus
+        {
+            get
+            {
+                return (bool)GetValue(KeyInputFocusProperty);
+            }
+            set
+            {
+                SetValue(KeyInputFocusProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
         /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Color BackgroundColor
         {
             get
             {
-                return (Color)GetValue(BackgroundColorProperty);
+                Color temp = (Color)GetValue(BackgroundColorProperty);
+                return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
             }
             set
             {
                 SetValue(BackgroundColorProperty, value);
+                if (selectorData != null)
+                {
+                    selectorData.BackgroundImage.Reset(this);
+                    selectorData.BackgroundColor.UpdateIfNeeds(this, value);
+                }
                 NotifyPropertyChanged();
             }
         }
@@ -186,6 +306,30 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 SetValue(BackgroundImageProperty, value);
+                if (selectorData != null)
+                {
+                    selectorData.BackgroundColor.Reset(this);
+                    selectorData.BackgroundImage.UpdateIfNeeds(this, value);
+                }
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
+        /// Get or set the border of background image.
+        /// </summary>
+        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Rectangle BackgroundImageBorder
+        {
+            get
+            {
+                return (Rectangle)GetValue(BackgroundImageBorderProperty);
+            }
+            set
+            {
+                SetValue(BackgroundImageBorderProperty, value);
+                selectorData?.BackgroundImageBorder.UpdateIfNeeds(this, value);
                 NotifyPropertyChanged();
             }
         }
@@ -208,6 +352,84 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// Describes a shadow as an image for a View.
+        /// It is null by default.
+        /// </summary>
+        /// <remarks>
+        /// Getter returns copied instance of current shadow.
+        /// </remarks>
+        /// <remarks>
+        /// The mutually exclusive with "BoxShadow".
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public ImageShadow ImageShadow
+        {
+            get
+            {
+                return (ImageShadow)GetValue(ImageShadowProperty);
+            }
+            set
+            {
+                SetValue(ImageShadowProperty, value);
+                if (selectorData != null)
+                {
+                    selectorData.BoxShadow.Reset(this);
+                    selectorData.ImageShadow.UpdateIfNeeds(this, value);
+                }
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
+        /// Describes a box shaped shadow drawing for a View.
+        /// It is null by default.
+        /// </summary>
+        /// <remarks>
+        /// Gettter returns copied instance of current shadow.
+        /// </remarks>
+        /// <remarks>
+        /// The mutually exclusive with "ImageShadow".
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Shadow BoxShadow
+        {
+            get
+            {
+                return (Shadow)GetValue(BoxShadowProperty);
+            }
+            set
+            {
+                SetValue(BoxShadowProperty, value);
+                if (selectorData != null)
+                {
+                    selectorData.ImageShadow.Reset(this);
+                    selectorData.BoxShadow.UpdateIfNeeds(this, value);
+                }
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
+        /// The radius for the rounded corners of the View.
+        /// This will rounds background and shadow edges.
+        /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public float CornerRadius
+        {
+            get
+            {
+                return (float)GetValue(CornerRadiusProperty);
+            }
+            set
+            {
+                SetValue(CornerRadiusProperty, value);
+                selectorData?.CornerRadius.UpdateIfNeeds(this, value);
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
         /// The current state of the view.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
@@ -277,6 +499,7 @@ namespace Tizen.NUI.BaseComponents
         /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated in API8, will be removed in API10.")]
         public float Flex
         {
             get
@@ -295,6 +518,7 @@ namespace Tizen.NUI.BaseComponents
         /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.<br />
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated in API8, will be removed in API10.")]
         public int AlignSelf
         {
             get
@@ -312,12 +536,17 @@ namespace Tizen.NUI.BaseComponents
         /// The Child property of FlexContainer.<br />
         /// The space around the flex item.<br />
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
+        [Obsolete("Deprecated in API8, will be removed in API10.")]
         public Vector4 FlexMargin
         {
             get
             {
-                return (Vector4)GetValue(FlexMarginProperty);
+                Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
+                return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
             }
             set
             {
@@ -329,12 +558,16 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// The top-left cell this child occupies, if not set, the first available cell is used.
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Vector2 CellIndex
         {
             get
             {
-                return (Vector2)GetValue(CellIndexProperty);
+                Vector2 temp = (Vector2)GetValue(CellIndexProperty);
+                return new Vector2(OnCellIndexChanged, temp.X, temp.Y);
             }
             set
             {
@@ -509,6 +742,43 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// Whether the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused.
+        /// Note : Default value is true.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool FocusableChildren
+        {
+            set
+            {
+                SetValue(FocusableChildrenProperty, value);
+                NotifyPropertyChanged();
+            }
+            get
+            {
+                return (bool)GetValue(FocusableChildrenProperty);
+            }
+        }
+
+        /// <summary>
+        /// Whether this view can focus by touch.
+        /// If Focusable is false, FocusableInTouch is disabled.
+        /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool FocusableInTouch
+        {
+            set
+            {
+                SetValue(FocusableInTouchProperty, value);
+                NotifyPropertyChanged();
+            }
+            get
+            {
+                return (bool)GetValue(FocusableInTouchProperty);
+            }
+        }
+
+        /// <summary>
         ///  Retrieves the position of the view.<br />
         ///  The coordinates are relative to the view's parent.<br />
         /// </summary>
@@ -530,11 +800,6 @@ namespace Tizen.NUI.BaseComponents
         /// <remarks>
         /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
         /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
-        /// Please note that this multi-cascade setting is especially possible for this NUI object (Size2D). <br />
-        /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters. <br />
-        /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f); <br />
-        /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f; <br />
-        /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimum size is set. <br />
         /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Size2D Size2D
@@ -542,10 +807,20 @@ namespace Tizen.NUI.BaseComponents
             get
             {
                 Size2D temp = (Size2D)GetValue(Size2DProperty);
-                return new Size2D(OnSize2DChanged, temp.Width, temp.Height);
+                int width = temp.Width;
+                int height = temp.Height;
+
+                if (this.Layout == null)
+                {
+                    if (width < 0) { width = 0; }
+                    if (height < 0) { height = 0; }
+                }
+
+                return new Size2D(OnSize2DChanged, width, height);
             }
             set
             {
+                sizeSetExplicitly = value;  // Store size set by API, will be used in place of NaturalSize if not set.
                 SetValue(Size2DProperty, value);
                 // Set Specification so when layouts measure this View it matches the value set here.
                 // All Views are currently Layouts.
@@ -553,6 +828,7 @@ namespace Tizen.NUI.BaseComponents
                 MeasureSpecificationHeight = new MeasureSpecification(new LayoutLength(value.Height), MeasureSpecification.ModeType.Exactly);
                 _widthPolicy = value.Width;
                 _heightPolicy = value.Height;
+                
                 _layout?.RequestLayout();
                 NotifyPropertyChanged();
             }
@@ -584,6 +860,7 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 SetValue(OpacityProperty, value);
+                selectorData?.Opacity.UpdateIfNeeds(this, value);
                 NotifyPropertyChanged();
             }
         }
@@ -596,10 +873,6 @@ namespace Tizen.NUI.BaseComponents
         /// <remarks>
         /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
         /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
-        /// Please note that this multi-cascade setting is especially possible for this NUI object (Position2D). <br />
-        /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters. <br />
-        /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f); <br />
-        /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f; <br />
         /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Position2D Position2D
@@ -632,7 +905,7 @@ namespace Tizen.NUI.BaseComponents
 
         /// <summary>
         /// Determines whether the pivot point should be used to determine the position of the view.
-        /// This is true by default.
+        /// This is false by default.
         /// </summary>
         /// <remarks>If false, then the top-left of the view is used for the position.
         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
@@ -720,6 +993,10 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 SetValue(SiblingOrderProperty, value);
+
+                LayoutGroup layout = Layout as LayoutGroup;
+                layout?.ChangeLayoutSiblingOrder(value);
+
                 NotifyPropertyChanged();
             }
         }
@@ -791,6 +1068,9 @@ namespace Tizen.NUI.BaseComponents
         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
         /// <pre>The view has been initialized.</pre>
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Position PivotPoint
         {
@@ -824,7 +1104,6 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 SetValue(SizeWidthProperty, value);
-                WidthSpecification = (int)Math.Ceiling(value);
                 NotifyPropertyChanged();
             }
         }
@@ -847,7 +1126,6 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 SetValue(SizeHeightProperty, value);
-                HeightSpecification = (int)Math.Ceiling(value);
                 NotifyPropertyChanged();
             }
         }
@@ -861,6 +1139,7 @@ namespace Tizen.NUI.BaseComponents
         /// <para>
         /// Animatable - This property can be animated using <c>Animation</c> class.
         /// </para>
+        /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
         /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Position Position
@@ -1004,13 +1283,15 @@ namespace Tizen.NUI.BaseComponents
         /// <para>
         /// Animatable - This property can be animated using <c>Animation</c> class.
         /// </para>
+        /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
         /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Vector3 Scale
         {
             get
             {
-                return (Vector3)GetValue(ScaleProperty);
+                Vector3 temp = (Vector3)GetValue(ScaleProperty);
+                return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
             }
             set
             {
@@ -1273,12 +1554,16 @@ namespace Tizen.NUI.BaseComponents
         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Vector3 SizeModeFactor
         {
             get
             {
-                return (Vector3)GetValue(SizeModeFactorProperty);
+                Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
+                return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
             }
             set
             {
@@ -1300,28 +1585,6 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 SetValue(WidthResizePolicyProperty, value);
-                // Match ResizePolicy to new Layouting.
-                // Parent relative policies can not be mapped at this point as parent size unknown.
-                switch (value)
-                {
-                    case ResizePolicyType.UseNaturalSize:
-                    {
-                        WidthSpecification = LayoutParamPolicies.WrapContent;
-                        break;
-                    }
-                    case ResizePolicyType.FillToParent:
-                    {
-                        WidthSpecification = LayoutParamPolicies.MatchParent;
-                        break;
-                    }
-                    case ResizePolicyType.FitToChildren:
-                    {
-                        WidthSpecification = LayoutParamPolicies.WrapContent;
-                        break;
-                    }
-                    default:
-                        break;
-                }
                 NotifyPropertyChanged();
             }
         }
@@ -1339,28 +1602,6 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 SetValue(HeightResizePolicyProperty, value);
-                // Match ResizePolicy to new Layouting.
-                // Parent relative policies can not be mapped at this point as parent size unknown.
-                switch (value)
-                {
-                    case ResizePolicyType.UseNaturalSize:
-                    {
-                        HeightSpecification = LayoutParamPolicies.WrapContent;
-                        break;
-                    }
-                    case ResizePolicyType.FillToParent:
-                    {
-                        HeightSpecification = LayoutParamPolicies.MatchParent;
-                        break;
-                    }
-                    case ResizePolicyType.FitToChildren:
-                    {
-                        HeightSpecification = LayoutParamPolicies.WrapContent;
-                        break;
-                    }
-                    default:
-                        break;
-                }
                 NotifyPropertyChanged();
             }
         }
@@ -1420,26 +1661,30 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// Gets or sets the padding for use in layout.
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
+        /// </remarks>
         /// <since_tizen> 5 </since_tizen>
         public Extents Padding
         {
             get
             {
                 // If View has a Layout then padding in stored in the base Layout class
-                if (Layout !=null)
+                if (Layout != null)
                 {
                     return Layout.Padding;
                 }
                 else
                 {
-                    return (Extents)GetValue(PaddingProperty);
+                    Extents temp = (Extents)GetValue(PaddingProperty);
+                    return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
                 }
                 // Two return points to prevent creating a zeroed Extent native object before assignment
             }
             set
             {
                 Extents padding = value;
-                if (Layout !=null)
+                if (Layout != null)
                 {
                     // Layout set so store Padding in LayoutItem instead of in View.
                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
@@ -1447,21 +1692,23 @@ namespace Tizen.NUI.BaseComponents
                     Layout.Padding = value;
                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
-                    if( Layout.GetType() != typeof(LayoutItem)) // If a Layout container of some kind.
+                    if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
                     {
-                        padding =  new Extents(0,0,0,0); // Reset value stored in View.
+                        padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
                     }
-                    _layout?.RequestLayout();
                 }
+
                 SetValue(PaddingProperty, padding);
                 NotifyPropertyChanged();
-                _layout?.RequestLayout();
             }
         }
 
         /// <summary>
         /// Gets or sets the minimum size the view can be assigned in size negotiation.
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Size2D MinimumSize
         {
@@ -1488,6 +1735,9 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// Gets or sets the maximum size the view can be assigned in size negotiation.
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         public Size2D MaximumSize
         {
@@ -1502,10 +1752,6 @@ namespace Tizen.NUI.BaseComponents
                 // MATCH_PARENT spec + parent container size can be used to limit
                 if (_layout != null)
                 {
-                    // Note: it only works if minimum size is >= than natural size.
-                    // To force the size it should be done through the width&height spec or Size2D.
-                    _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Width);
-                    _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Height);
                     _layout.RequestLayout();
                 }
                 SetValue(MaximumSizeProperty, value);
@@ -1564,6 +1810,9 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
+        /// </remarks>
         /// <since_tizen> 3 </since_tizen>
         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
             "Like: " +
@@ -1577,7 +1826,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 Position temp = new Position(0.0f, 0.0f, 0.0f);
                 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
-                return temp;
+                return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
             }
             set
             {
@@ -1594,15 +1843,9 @@ namespace Tizen.NUI.BaseComponents
         /// </summary>
         /// <remarks>
         /// <para>
-        /// Please note that multi-cascade setting is not possible for this NUI object. <br />
-        /// It is recommended that NUI object typed properties are configured by their constructor with parameters. <br />
-        /// For example, this code is working fine : view.Size = new Size( 1.0f, 1.0f, 0.0f); <br />
-        /// but this will not work! : view.Size.Width = 2.0f; view.Size.Height = 2.0f; <br />
-        /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimu size is set. <br />
-        /// </para>
-        /// <para>
         /// Animatable - This property can be animated using <c>Animation</c> class.
         /// </para>
+        /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
         /// </remarks>
         /// <since_tizen> 5 </since_tizen>
         public Size Size
@@ -1615,10 +1858,6 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 SetValue(SizeProperty, value);
-                // Set Specification so when layouts measure this View it matches the value set here.
-                // All Views are currently Layouts.
-                WidthSpecification = (int)Math.Ceiling(value.Width);
-                HeightSpecification = (int)Math.Ceiling(value.Height);
                 NotifyPropertyChanged();
             }
         }
@@ -1644,7 +1883,7 @@ namespace Tizen.NUI.BaseComponents
                 if (basehandle is Layer layer)
                 {
                     ret = new View(Layer.getCPtr(layer).Handle, false);
-                    NUILog.Error("This Parent property is deprecated, shoud do not be used");
+                    NUILog.Error("This Parent property is deprecated, should do not be used");
                 }
                 else
                 {
@@ -1701,6 +1940,7 @@ namespace Tizen.NUI.BaseComponents
         /// <remarks>
         /// Margin property is supported by Layout algorithms and containers.
         /// Please Set Layout if you want to use Margin property.
+        /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
         /// </remarks>
         /// <since_tizen> 4 </since_tizen>
         public Extents Margin
@@ -1715,7 +1955,8 @@ namespace Tizen.NUI.BaseComponents
                 else
                 {
                     // If Layout not set then return margin stored in View.
-                    return (Extents)GetValue(MarginProperty);
+                    Extents temp = (Extents)GetValue(MarginProperty);
+                    return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
                 }
                 // Two return points to prevent creating a zeroed Extent native object before assignment
             }
@@ -1752,13 +1993,21 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 _widthPolicy = value;
-                if (_widthPolicy >= 0)
+                if( _oldWidthPolicy != _widthPolicy )
                 {
-                    _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
-                    Size2D.Width = _widthPolicy;
+                    if (_widthPolicy >= 0)
+                    {
+                        _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
 
+                        if(_heightPolicy>=0) // Policy an exact value
+                        {
+                            // Create Size2D only both _widthPolicy and _heightPolicy are set.
+                            Size2D = new Size2D(_widthPolicy,_heightPolicy);
+                        }
+                    }
+                    _layout?.RequestLayout();
+                    _oldWidthPolicy = _widthPolicy;
                 }
-                _layout?.RequestLayout();
             }
         }
 
@@ -1766,7 +2015,6 @@ namespace Tizen.NUI.BaseComponents
         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
         ///</summary>
         /// <since_tizen> 6 </since_tizen>
-        [EditorBrowsable(EditorBrowsableState.Never)]
         public int HeightSpecification
         {
             get
@@ -1776,13 +2024,22 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 _heightPolicy = value;
-                if (_heightPolicy >= 0)
+                if( _oldHeightPolicy != _heightPolicy )
                 {
-                    _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
-                    Size2D.Height = _heightPolicy;
+                    if (_heightPolicy >= 0)
+                    {
+                        _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
+
+                        if(_widthPolicy>=0) // Policy an exact value
+                        {
+                            // Create Size2D only both _widthPolicy and _heightPolicy are set.
+                            Size2D = new Size2D(_widthPolicy,_heightPolicy);
+                        }
 
+                    }
+                    _layout?.RequestLayout();
+                    _oldHeightPolicy = _heightPolicy;
                 }
-               _layout?.RequestLayout();
             }
         }
 
@@ -1826,6 +2083,9 @@ namespace Tizen.NUI.BaseComponents
         /// <summary>
         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
         /// </summary>
+        /// <remarks>
+        /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
+        /// </remarks>
         /// <since_tizen> 4 </since_tizen>
         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -1835,7 +2095,7 @@ namespace Tizen.NUI.BaseComponents
             {
                 Extents temp = new Extents(0, 0, 0, 0);
                 GetProperty(View.Property.PADDING).Get(temp);
-                return temp;
+                return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
             }
             set
             {
@@ -1867,18 +2127,22 @@ namespace Tizen.NUI.BaseComponents
         /// <para>
         /// Animatable - This property can be animated using <c>Animation</c> class.
         /// </para>
+        /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
         /// </remarks>
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public Color Color
         {
-            set
+            get
             {
-                SetColor(value);
+                Color temp = (Color)GetValue(ColorProperty);
+                return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
             }
-            get
+            set
             {
-                return GetCurrentColor();
+                SetValue(ColorProperty, value);
+                selectorData?.Color.UpdateIfNeeds(this, value);
+                NotifyPropertyChanged();
             }
         }
 
@@ -1900,7 +2164,6 @@ namespace Tizen.NUI.BaseComponents
                     return;
                 }
 
-                Log.Info("NUI", "Setting Layout on:" + Name + "\n");
                 layoutingDisabled = false;
                 layoutSet = true;
 
@@ -1909,11 +2172,14 @@ namespace Tizen.NUI.BaseComponents
                 if (value?.Owner != null)
                 {
                     // Previous owner of the layout gets a default layout as a replacement.
-                    value.Owner.Layout = new LayoutGroup();
+                    value.Owner.Layout = new AbsoluteLayout();
 
                     // Copy Margin and Padding to replacement LayoutGroup.
-                    value.Owner.Layout.Margin = value.Margin;
-                    value.Owner.Layout.Padding = value.Padding;
+                    if (value.Owner.Layout != null)
+                    {
+                        value.Owner.Layout.Margin = value.Margin;
+                        value.Owner.Layout.Padding = value.Padding;
+                    }
                 }
 
                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
@@ -1938,24 +2204,28 @@ namespace Tizen.NUI.BaseComponents
                 else
                 {
                     // First Layout to be added to the View hence copy
-
                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
-                    if (value !=null)
+                    if (value != null)
                     {
-                        if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
+                        if (Margin.Top != 0 || Margin.Bottom != 0 || Margin.Start != 0 || Margin.End != 0)
                         {
                             // If View already has a margin set then store it in Layout instead.
                             value.Margin = Margin;
-                            SetValue(MarginProperty, new Extents(0,0,0,0));
+                            SetValue(MarginProperty, new Extents(0, 0, 0, 0));
                             NotifyPropertyChanged();
                         }
 
-                        if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
+                        if (Padding.Top != 0 || Padding.Bottom != 0 || Padding.Start != 0 || Padding.End != 0)
                         {
                             // If View already has a padding set then store it in Layout instead.
                             value.Padding = Padding;
-                            SetValue(PaddingProperty, new Extents(0,0,0,0));
-                            NotifyPropertyChanged();
+                            // If Layout is a LayoutItem then it could be a View that handles it's own padding.
+                            // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
+                            if (typeof(LayoutGroup).IsAssignableFrom(value.GetType())) // If a Layout container of some kind.
+                            {
+                                SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
+                                NotifyPropertyChanged();
+                            }
                         }
                     }
                 }
@@ -2001,15 +2271,11 @@ namespace Tizen.NUI.BaseComponents
             set
             {
                 _backgroundImageSynchronosLoading = value;
-                string bgUrl = "";
-                int visualType = 0;
-                Background.Find(Visual.Property.Type)?.Get(out visualType);
-                if (visualType == (int)Visual.Type.Image)
-                {
-                    Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
-                }
 
-                if (bgUrl.Length != 0)
+                string bgUrl = null;
+                Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
+
+                if (!string.IsNullOrEmpty(bgUrl))
                 {
                     PropertyMap bgMap = this.Background;
                     bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading));
@@ -2047,5 +2313,150 @@ namespace Tizen.NUI.BaseComponents
                 LoadTransitions();
             }
         }
+
+        /// <summary>
+        /// Enable/Disable ControlState propagation for children.
+        /// It is false by default.
+        /// If the View needs to share ControlState with descendants, please set it true.
+        /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool EnableControlStatePropagation
+        {
+            get => controlStatePropagation;
+            set
+            {
+                controlStatePropagation = value;
+
+                foreach (View child in Children)
+                {
+                    child.EnableControlStatePropagation = value;
+                }
+            }
+        }
+
+        /// <summary>
+        /// If this property is set to true, the View can have a touch related ControlState (such as Pressed) when touch.
+        /// By default, it is false in View, true in Control.
+        /// Note that if the value is true, the View will be a touch receptor.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool EnableControlState
+        {
+            get
+            {
+                return (bool)GetValue(EnableControlStateProperty);
+            }
+            set
+            {
+                SetValue(EnableControlStateProperty, value);
+            }
+        }
+
+         /// <summary>
+        /// Whether the actor grab all touches even if touch leaves its boundary.
+        /// </summary>
+        /// <returns>true, if it grab all touch after start</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool GrabTouchAfterLeave
+        {
+            get
+            {
+                bool temp = false;
+                GetProperty(View.Property.CaptureAllTouchAfterStart).Get(out temp);
+                return temp;
+            }
+            set
+            {
+                SetProperty(View.Property.CaptureAllTouchAfterStart, new Tizen.NUI.PropertyValue(value));
+                NotifyPropertyChanged();
+            }
+        }
+
+        /// <summary>
+        /// If the value is true, the View will change its style as the theme changes.
+        /// It is false by default, but turned to true when setting StyleName (by setting property or using specified constructor).
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool ThemeChangeSensitive
+        {
+            get => (bool)GetValue(ThemeChangeSensitiveProperty);
+            set => SetValue(ThemeChangeSensitiveProperty, value);
+        }
+
+        /// <summary>
+        /// Get Style, it is abstract function and must be override.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        // TODO: It should be deprecated. please use CreateViewStyle instead.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual ViewStyle GetViewStyle()
+        {
+            return CreateViewStyle();
+        }
+
+        /// <summary>
+        /// Create Style, it is abstract function and must be override.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual ViewStyle CreateViewStyle()
+        {
+            return new ViewStyle();
+        }
+
+        /// <summary>
+        /// Called after the View's ControlStates changed.
+        /// </summary>
+        /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
+        {
+        }
+
+        /// <summary>
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
+        {
+            UpdateStyle();
+        }
+
+        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public virtual void ApplyStyle(ViewStyle viewStyle)
+        {
+            if (null == viewStyle || this.viewStyle == viewStyle) return;
+
+            this.viewStyle = viewStyle;
+
+            Dictionary<string, BindableProperty> bindablePropertyOfView;
+            Type viewType = GetType();
+
+            Dictionary<string, BindableProperty> bindablePropertyOfStyle;
+            Type styleType = viewStyle.GetType();
+
+            BindableProperty.GetBindablePropertysOfType(viewType, out bindablePropertyOfView);
+            BindableProperty.GetBindablePropertysOfType(styleType, out bindablePropertyOfStyle);
+
+            if (null != bindablePropertyOfView && null != bindablePropertyOfStyle)
+            {
+                foreach (KeyValuePair<string, BindableProperty> keyValuePair in bindablePropertyOfStyle)
+                {
+                    BindableProperty viewProperty;
+                    bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
+
+                    if (null != viewProperty && viewProperty != StyleNameProperty)
+                    {
+                        object value = viewStyle.GetValue(keyValuePair.Value);
+
+                        if (null != value)
+                        {
+                            SetValue(viewProperty, value);
+                        }
+                    }
+                }
+            }
+        }
     }
 }