[NUI] Add InterceptWheelEvent
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewInternal.cs
index fa69534..dc168bb 100755 (executable)
@@ -1,5 +1,5 @@
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+/*
+ * Copyright(c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,6 +17,8 @@
 
 using System;
 using System.ComponentModel;
+using global::System.Diagnostics;
+using Tizen.NUI;
 
 namespace Tizen.NUI.BaseComponents
 {
@@ -26,10 +28,63 @@ namespace Tizen.NUI.BaseComponents
     /// <since_tizen> 3 </since_tizen>
     public partial class View
     {
-        private ViewSelectorData selectorData;
-
         internal string styleName;
 
+        internal virtual LayoutItem CreateDefaultLayout()
+        {
+            return new AbsoluteLayout();
+        }
+
+        internal class ThemeData
+        {
+            [Flags]
+            private enum States : byte
+            {
+                None = 0,
+                ControlStatePropagation = 1 << 0,
+                ThemeChangeSensitive = 1 << 1,
+                ThemeApplied = 1 << 2, // It is true when the view has valid style name or the platform theme has a component style for this view type.
+                                       // That indicates the view can have different styles by theme.
+                                       // Hence if the current state has ThemeApplied and ThemeChangeSensitive, the view will change its style by theme changing.
+                ListeningThemeChangeEvent = 1 << 3,
+            };
+
+            private States states = ThemeManager.ApplicationThemeChangeSensitive ? States.ThemeChangeSensitive : States.None;
+            public ViewStyle viewStyle;
+            public ControlState controlStates = ControlState.Normal;
+            public ViewSelectorData selectorData;
+
+            public bool ControlStatePropagation
+            {
+                get => ((states & States.ControlStatePropagation) != 0);
+                set => SetOption(States.ControlStatePropagation, value);
+            }
+
+            public bool ThemeChangeSensitive
+            {
+                get => ((states & States.ThemeChangeSensitive) != 0);
+                set => SetOption(States.ThemeChangeSensitive, value);
+            }
+
+            public bool ThemeApplied
+            {
+                get => ((states & States.ThemeApplied) != 0);
+                set => SetOption(States.ThemeApplied, value);
+            }
+
+            public bool ListeningThemeChangeEvent
+            {
+                get => ((states & States.ListeningThemeChangeEvent) != 0);
+                set => SetOption(States.ListeningThemeChangeEvent, value);
+            }
+
+            private void SetOption(States option, bool value)
+            {
+                if (value) states |= option;
+                else states &= ~option;
+            }
+        }
+
         /// <summary>
         /// The color mode of View.
         /// This specifies whether the View uses its own color, or inherits its parent color.
@@ -73,11 +128,8 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                float returnValue = 0.0f;
-                PropertyValue wordPositionX = GetProperty(View.Property.WorldPositionX);
-                wordPositionX?.Get(out returnValue);
-                wordPositionX?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyFloat(SwigCPtr, View.Property.WorldPositionX);
             }
         }
 
@@ -85,11 +137,8 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                float returnValue = 0.0f;
-                PropertyValue wordPositionY = GetProperty(View.Property.WorldPositionY);
-                wordPositionY?.Get(out returnValue);
-                wordPositionY?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyFloat(SwigCPtr, View.Property.WorldPositionY);
             }
         }
 
@@ -97,11 +146,8 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                float returnValue = 0.0f;
-                PropertyValue wordPositionZ = GetProperty(View.Property.WorldPositionZ);
-                wordPositionZ?.Get(out returnValue);
-                wordPositionZ?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyFloat(SwigCPtr, View.Property.WorldPositionZ);
             }
         }
 
@@ -119,7 +165,8 @@ namespace Tizen.NUI.BaseComponents
 
         internal void SetLayout(LayoutItem layout)
         {
-            Window.Instance.LayoutController.CreateProcessCallback();
+            LayoutCount++;
+
             this.layout = layout;
             this.layout?.AttachToOwner(this);
             this.layout?.RequestLayout();
@@ -140,17 +187,13 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                float returnValue = 0.0f;
-                PropertyValue parentOriginX = GetProperty(View.Property.ParentOriginX);
-                parentOriginX?.Get(out returnValue);
-                parentOriginX?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyFloat(SwigCPtr, View.Property.ParentOriginX);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.ParentOriginX, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyFloat(SwigCPtr, View.Property.WorldPositionX, value);
                 NotifyPropertyChanged();
             }
         }
@@ -159,17 +202,13 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                float returnValue = 0.0f;
-                PropertyValue parentOriginY = GetProperty(View.Property.ParentOriginY);
-                parentOriginY?.Get(out returnValue);
-                parentOriginY?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyFloat(SwigCPtr, View.Property.ParentOriginY);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.ParentOriginY, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyFloat(SwigCPtr, View.Property.ParentOriginY, value);
                 NotifyPropertyChanged();
             }
         }
@@ -178,17 +217,13 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                float returnValue = 0.0f;
-                PropertyValue parentOriginZ = GetProperty(View.Property.ParentOriginZ);
-                parentOriginZ?.Get(out returnValue);
-                parentOriginZ?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyFloat(SwigCPtr, View.Property.ParentOriginZ);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.ParentOriginZ, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyFloat(SwigCPtr, View.Property.ParentOriginZ, value);
                 NotifyPropertyChanged();
             }
         }
@@ -197,17 +232,13 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                float returnValue = 0.0f;
-                PropertyValue anchorPointX = GetProperty(View.Property.AnchorPointX);
-                anchorPointX?.Get(out returnValue);
-                anchorPointX?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyFloat(SwigCPtr, View.Property.AnchorPointX);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.AnchorPointX, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyFloat(SwigCPtr, View.Property.AnchorPointX, value);
             }
         }
 
@@ -215,17 +246,13 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                float returnValue = 0.0f;
-                PropertyValue anchorPointY = GetProperty(View.Property.AnchorPointY);
-                anchorPointY?.Get(out returnValue);
-                anchorPointY?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyFloat(SwigCPtr, View.Property.AnchorPointY);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.AnchorPointY, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyFloat(SwigCPtr, View.Property.AnchorPointY, value);
             }
         }
 
@@ -233,17 +260,13 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                float returnValue = 0.0f;
-                PropertyValue anchorPointZ = GetProperty(View.Property.AnchorPointZ);
-                anchorPointZ?.Get(out returnValue);
-                anchorPointZ?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyFloat(SwigCPtr, View.Property.AnchorPointZ);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.AnchorPointZ, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyFloat(SwigCPtr, View.Property.AnchorPointZ, value);
             }
         }
 
@@ -260,6 +283,45 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// The number of layouts including view's layout and children's layouts.
+        /// This can be used to set/unset Process callback to calculate Layout.
+        /// </summary>
+        internal int LayoutCount
+        {
+            get
+            {
+                return layoutCount;
+            }
+
+            set
+            {
+                if (layoutCount == value) return;
+
+                if (value < 0) throw new global::System.ArgumentOutOfRangeException(nameof(LayoutCount), "LayoutCount(" + LayoutCount + ") should not be less than zero");
+
+                int diff = value - layoutCount;
+                layoutCount = value;
+
+                if (InternalParent != null)
+                {
+                    var parentView = InternalParent as View;
+                    if (parentView != null)
+                    {
+                        parentView.LayoutCount += diff;
+                    }
+                    else
+                    {
+                        var parentLayer = InternalParent as Layer;
+                        if (parentLayer != null)
+                        {
+                            parentLayer.LayoutCount += diff;
+                        }
+                    }
+                }
+            }
+        }
+
+        /// <summary>
         /// Indicates that this View should listen Touch event to handle its ControlState.
         /// </summary>
         private bool enableControlState = false;
@@ -268,17 +330,13 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                int returnValue = 0;
-                PropertyValue leftFocusableViewId = GetProperty(View.Property.LeftFocusableViewId);
-                leftFocusableViewId?.Get(out returnValue);
-                leftFocusableViewId?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyInt(SwigCPtr, View.Property.LeftFocusableViewId);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.LeftFocusableViewId, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyInt(SwigCPtr, View.Property.LeftFocusableViewId, value);
             }
         }
 
@@ -286,17 +344,13 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                int returnValue = 0;
-                PropertyValue rightFocusableViewId = GetProperty(View.Property.RightFocusableViewId);
-                rightFocusableViewId?.Get(out returnValue);
-                rightFocusableViewId?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyInt(SwigCPtr, View.Property.RightFocusableViewId);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.RightFocusableViewId, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyInt(SwigCPtr, View.Property.RightFocusableViewId, value);
             }
         }
 
@@ -304,17 +358,13 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                int returnValue = 0;
-                PropertyValue upFocusableViewId = GetProperty(View.Property.UpFocusableViewId);
-                upFocusableViewId?.Get(out returnValue);
-                upFocusableViewId?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyInt(SwigCPtr, View.Property.UpFocusableViewId);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.UpFocusableViewId, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyInt(SwigCPtr, View.Property.UpFocusableViewId, value);
             }
         }
 
@@ -322,138 +372,42 @@ namespace Tizen.NUI.BaseComponents
         {
             get
             {
-                int returnValue = 0;
-                PropertyValue downFocusableViewId = GetProperty(View.Property.DownFocusableViewId);
-                downFocusableViewId?.Get(out returnValue);
-                downFocusableViewId?.Dispose();
-                return returnValue;
+
+                return Object.InternalGetPropertyInt(SwigCPtr, View.Property.DownFocusableViewId);
             }
             set
             {
-                PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
-                SetProperty(View.Property.DownFocusableViewId, setValue);
-                setValue.Dispose();
+
+                Object.InternalSetPropertyInt(SwigCPtr, View.Property.DownFocusableViewId, value);
             }
         }
 
-        internal void Raise()
+        private int ClockwiseFocusableViewId
         {
-            var parentChildren = GetParent()?.Children;
-
-            if (parentChildren != null)
+            get
             {
-                int currentIndex = parentChildren.IndexOf(this);
 
-                // If the view is not already the last item in the list.
-                if (currentIndex >= 0 && currentIndex < parentChildren.Count - 1)
-                {
-                    View temp = parentChildren[currentIndex + 1];
-                    parentChildren[currentIndex + 1] = this;
-                    parentChildren[currentIndex] = temp;
-
-                    Interop.NDalic.Raise(SwigCPtr);
-                    if (NDalicPINVOKE.SWIGPendingException.Pending)
-                        throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                }
+                return Object.InternalGetPropertyInt(SwigCPtr, View.Property.ClockwiseFocusableViewId);
             }
-        }
-
-        internal void Lower()
-        {
-            var parentChildren = GetParent()?.Children;
-
-            if (parentChildren != null)
+            set
             {
-                int currentIndex = parentChildren.IndexOf(this);
-
-                // If the view is not already the first item in the list.
-                if (currentIndex > 0 && currentIndex < parentChildren.Count)
-                {
-                    View temp = parentChildren[currentIndex - 1];
-                    parentChildren[currentIndex - 1] = this;
-                    parentChildren[currentIndex] = temp;
 
-                    Interop.NDalic.Lower(SwigCPtr);
-                    if (NDalicPINVOKE.SWIGPendingException.Pending)
-                        throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                }
+                Object.InternalSetPropertyInt(SwigCPtr, View.Property.ClockwiseFocusableViewId, value);
             }
         }
 
-        /// <summary>
-        /// Raises the view to above the target view.
-        /// </summary>
-        /// <remarks>The sibling order of views within the parent will be updated automatically.
-        /// Views on the level above the target view will still be shown above this view.
-        /// Raising this view above views with the same sibling order as each other will raise this view above them.
-        /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
-        /// </remarks>
-        /// <param name="target">Will be raised above this view.</param>
-        internal void RaiseAbove(View target)
+        private int CounterClockwiseFocusableViewId
         {
-            var parentChildren = GetParent()?.Children;
-
-            if (parentChildren != null)
+            get
             {
-                int currentIndex = parentChildren.IndexOf(this);
-                int targetIndex = parentChildren.IndexOf(target);
 
-                if (currentIndex < 0 || targetIndex < 0 ||
-                    currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
-                {
-                    NUILog.Error("index should be bigger than 0 and less than children of layer count");
-                    return;
-                }
-                // If the currentIndex is less than the target index and the target has the same parent.
-                if (currentIndex < targetIndex)
-                {
-                    parentChildren.Remove(this);
-                    parentChildren.Insert(targetIndex, this);
-
-                    Interop.NDalic.RaiseAbove(SwigCPtr, View.getCPtr(target));
-                    if (NDalicPINVOKE.SWIGPendingException.Pending)
-                        throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                }
+                return Object.InternalGetPropertyInt(SwigCPtr, View.Property.CounterClockwiseFocusableViewId);
             }
-
-        }
-
-        /// <summary>
-        /// Lowers the view to below the target view.
-        /// </summary>
-        /// <remarks>The sibling order of views within the parent will be updated automatically.
-        /// Lowering this view below views with the same sibling order as each other will lower this view above them.
-        /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
-        /// </remarks>
-        /// <param name="target">Will be lowered below this view.</param>
-        internal void LowerBelow(View target)
-        {
-            var parentChildren = GetParent()?.Children;
-
-            if (parentChildren != null)
+            set
             {
-                int currentIndex = parentChildren.IndexOf(this);
-                int targetIndex = parentChildren.IndexOf(target);
-                if (currentIndex < 0 || targetIndex < 0 ||
-                   currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
-                {
-                    NUILog.Error("index should be bigger than 0 and less than children of layer count");
-                    return;
-                }
-
-                // If the currentIndex is not already the 0th index and the target has the same parent.
-                if ((currentIndex != 0) && (targetIndex != -1) &&
-                    (currentIndex > targetIndex))
-                {
-                    parentChildren.Remove(this);
-                    parentChildren.Insert(targetIndex, this);
 
-                    Interop.NDalic.LowerBelow(SwigCPtr, View.getCPtr(target));
-                    if (NDalicPINVOKE.SWIGPendingException.Pending)
-                        throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                }
+                Object.InternalSetPropertyInt(SwigCPtr, View.Property.CounterClockwiseFocusableViewId, value);
             }
-
         }
 
         internal string GetName()
@@ -508,34 +462,52 @@ namespace Tizen.NUI.BaseComponents
             return FindChildById(id);
         }
 
-        internal void SetParentOrigin(Vector3 origin)
+        internal void SetParentOrigin(Position origin)
         {
-            Interop.ActorInternal.SetParentOrigin(SwigCPtr, Vector3.getCPtr(origin));
+            Interop.ActorInternal.SetParentOrigin(SwigCPtr, Position.getCPtr(origin));
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal Vector3 GetCurrentParentOrigin()
+        internal Position GetCurrentParentOrigin()
         {
-            Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentParentOrigin(SwigCPtr), true);
+
+            if(internalCurrentParentOrigin == null)
+            {
+                internalCurrentParentOrigin = new Position(0, 0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveCurrentPropertyVector3(SwigCPtr, View.Property.ParentOrigin, internalCurrentParentOrigin.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            }
+            return internalCurrentParentOrigin;
         }
 
-        internal void SetAnchorPoint(Vector3 anchorPoint)
+        internal void SetAnchorPoint(Position anchorPoint)
         {
-            Interop.Actor.SetAnchorPoint(SwigCPtr, Vector3.getCPtr(anchorPoint));
+            Interop.Actor.SetAnchorPoint(SwigCPtr, Position.getCPtr(anchorPoint));
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal Vector3 GetCurrentAnchorPoint()
+        internal Position GetCurrentAnchorPoint()
         {
-            Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentAnchorPoint(SwigCPtr), true);
+
+            if(internalCurrentAnchorPoint == null)
+            {
+                internalCurrentAnchorPoint = new Position(0, 0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveCurrentPropertyVector3(SwigCPtr, View.Property.AnchorPoint, internalCurrentAnchorPoint.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            }
+            return internalCurrentAnchorPoint;
         }
 
         internal void SetSize(float width, float height)
@@ -568,20 +540,36 @@ namespace Tizen.NUI.BaseComponents
 
         internal Vector3 GetTargetSize()
         {
-            Vector3 ret = new Vector3(Interop.ActorInternal.GetTargetSize(SwigCPtr), true);
+
+            if(internalTargetSize == null)
+            {
+                internalTargetSize = new Vector3(0, 0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveTargetSize(SwigCPtr, internalTargetSize.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            }
+            return internalTargetSize;
         }
 
         internal Size2D GetCurrentSize()
         {
-            Size ret = new Size(Interop.Actor.GetCurrentSize(SwigCPtr), true);
+
+            if(internalCurrentSize == null)
+            {
+                internalCurrentSize = new Size2D(0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveCurrentPropertyVector2ActualVector3(SwigCPtr, Property.SIZE, internalCurrentSize.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            Size2D size = new Size2D((int)ret.Width, (int)ret.Height);
-            ret.Dispose();
-            return size;
+            }
+            return internalCurrentSize;
         }
 
         internal Size2D GetCurrentSizeFloat()
@@ -592,7 +580,11 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
-        internal Vector3 GetNaturalSize()
+        /// <summary>
+        /// GetNaturalSize() function behaviour can be changed for each subclass of View.
+        /// So we make GetNaturalSize() function virtual, and make subclass can define it's owned logic
+        /// </summary>
+        internal virtual Vector3 GetNaturalSize()
         {
             Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending)
@@ -600,27 +592,6 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
-        internal void SetPosition(float x, float y)
-        {
-            Interop.ActorInternal.SetPosition(SwigCPtr, x, y);
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        internal void SetPosition(float x, float y, float z)
-        {
-            Interop.ActorInternal.SetPosition(SwigCPtr, x, y, z);
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        internal void SetPosition(Vector3 position)
-        {
-            Interop.ActorInternal.SetPosition(SwigCPtr, Vector3.getCPtr(position));
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
         internal void SetX(float x)
         {
             Interop.ActorInternal.SetX(SwigCPtr, x);
@@ -651,17 +622,58 @@ namespace Tizen.NUI.BaseComponents
 
         internal Position GetCurrentPosition()
         {
-            Position ret = new Position(Interop.Actor.GetCurrentPosition(SwigCPtr), true);
+
+            if(internalCurrentPosition == null)
+            {
+                internalCurrentPosition = new Position(0, 0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveCurrentPropertyVector3(SwigCPtr, Property.POSITION, internalCurrentPosition.SwigCPtr);
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+            return internalCurrentPosition;
+        }
+        internal Vector3 GetCurrentWorldPosition()
+        {
+
+            if(internalCurrentWorldPosition == null)
+            {
+                internalCurrentWorldPosition = new Vector3(0, 0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveCurrentPropertyVector3(SwigCPtr, View.Property.WorldPosition, internalCurrentWorldPosition.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            }
+            return internalCurrentWorldPosition;
         }
 
-        internal Vector3 GetCurrentWorldPosition()
+        internal Vector2 GetCurrentScreenPosition()
         {
-            Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentWorldPosition(SwigCPtr), true);
+
+            if(internalCurrentScreenPosition == null)
+            {
+                internalCurrentScreenPosition = new Vector2(0, 0);
+            }
+
+            Object.InternalRetrievingPropertyVector2(SwigCPtr, View.Property.ScreenPosition, internalCurrentScreenPosition.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+            return internalCurrentScreenPosition;
+        }
+
+        internal Vector4 GetCurrentScreenPositionSize()
+        {
+            Vector4 ret = new Vector4(Interop.Actor.CurrentScreenExtents(SwigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
             return ret;
         }
 
@@ -755,18 +767,36 @@ namespace Tizen.NUI.BaseComponents
 
         internal Vector3 GetCurrentScale()
         {
-            Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentScale(SwigCPtr), true);
+
+            if(internalCurrentScale == null)
+            {
+                internalCurrentScale = new Vector3(0, 0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveCurrentPropertyVector3(SwigCPtr, View.Property.SCALE, internalCurrentScale.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            }
+            return internalCurrentScale;
         }
 
         internal Vector3 GetCurrentWorldScale()
         {
-            Vector3 ret = new Vector3(Interop.ActorInternal.GetCurrentWorldScale(SwigCPtr), true);
+
+            if(internalCurrentWorldScale == null)
+            {
+                internalCurrentWorldScale = new Vector3(0, 0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveCurrentPropertyVector3(SwigCPtr, View.Property.WorldScale, internalCurrentWorldScale.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            }
+            return internalCurrentWorldScale;
         }
 
         internal void SetInheritScale(bool inherit)
@@ -799,6 +829,13 @@ namespace Tizen.NUI.BaseComponents
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Retrieve the View's current Visibility.
+        /// </summary>
+        /// <remarks>
+        /// The <see cref="Visibility"/> property is set in the main thread, so it is not updated in real time when the value is changed in the render thread.
+        /// However, this method can get the current actual value updated in real time.
+        /// </remarks>
         internal bool IsVisible()
         {
             bool ret = Interop.ActorInternal.IsVisible(SwigCPtr);
@@ -822,19 +859,21 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
-        internal void SetColor(Vector4 color)
-        {
-            Interop.ActorInternal.SetColor(SwigCPtr, Vector4.getCPtr(color));
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
         internal Vector4 GetCurrentColor()
         {
-            Vector4 ret = new Vector4(Interop.ActorInternal.GetCurrentColor(SwigCPtr), true);
+
+            if(internalCurrentColor == null)
+            {
+                internalCurrentColor = new Vector4(0, 0, 0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveCurrentPropertyVector4(SwigCPtr, Interop.ActorProperty.ColorGet(), internalCurrentColor.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            }
+            return internalCurrentColor;
         }
         internal ColorMode GetColorMode()
         {
@@ -846,10 +885,19 @@ namespace Tizen.NUI.BaseComponents
 
         internal Vector4 GetCurrentWorldColor()
         {
-            Vector4 ret = new Vector4(Interop.ActorInternal.GetCurrentWorldColor(SwigCPtr), true);
+
+            if(internalCurrentWorldColor == null)
+            {
+                internalCurrentWorldColor = new Vector4(0, 0, 0, 0);
+            }
+
+            Interop.ActorInternal.RetrieveCurrentPropertyVector4(SwigCPtr, Property.WorldColor, internalCurrentWorldColor.SwigCPtr);
+
             if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            }
+            return internalCurrentWorldColor;
         }
 
         internal void SetDrawMode(DrawModeType drawMode)
@@ -882,6 +930,36 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
+        internal void SetKeyboardFocusableChildren(bool focusable)
+        {
+            Interop.ActorInternal.SetKeyboardFocusableChildren(SwigCPtr, focusable);
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal bool AreChildrenKeyBoardFocusable()
+        {
+            bool ret = Interop.ActorInternal.AreChildrenKeyBoardFocusable(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        internal void SetFocusableInTouch(bool enabled)
+        {
+            Interop.ActorInternal.SetFocusableInTouch(SwigCPtr, enabled);
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal bool IsFocusableInTouch()
+        {
+            bool ret = Interop.ActorInternal.IsFocusableInTouch(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
         {
             Interop.Actor.SetResizePolicy(SwigCPtr, (int)policy, (int)dimension);
@@ -899,10 +977,13 @@ namespace Tizen.NUI.BaseComponents
 
         internal Vector3 GetSizeModeFactor()
         {
-            Vector3 ret = new Vector3(Interop.Actor.GetSizeModeFactor(SwigCPtr), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+
+                if (internalSizeModeFactor == null)
+                {
+                    internalSizeModeFactor = new Vector3(OnSizeModeFactorChanged, 0, 0, 0);
+                }
+                Object.InternalRetrievingPropertyVector3(SwigCPtr, View.Property.SizeModeFactor, internalSizeModeFactor.SwigCPtr);
+                return internalSizeModeFactor;
         }
 
         internal void SetMinimumSize(Vector2 size)
@@ -914,10 +995,13 @@ namespace Tizen.NUI.BaseComponents
 
         internal Vector2 GetMinimumSize()
         {
-            Vector2 ret = new Vector2(Interop.ActorInternal.GetMinimumSize(SwigCPtr), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+
+            if (internalMinimumSize == null)
+            {
+                internalMinimumSize = new Size2D(OnMinimumSizeChanged, 0, 0);
+            }
+            Object.InternalRetrievingPropertyVector2(SwigCPtr, View.Property.MinimumSize, internalMinimumSize.SwigCPtr);
+            return internalMinimumSize;
         }
 
         internal void SetMaximumSize(Vector2 size)
@@ -929,10 +1013,13 @@ namespace Tizen.NUI.BaseComponents
 
         internal Vector2 GetMaximumSize()
         {
-            Vector2 ret = new Vector2(Interop.ActorInternal.GetMaximumSize(SwigCPtr), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+
+            if (internalMaximumSize == null)
+            {
+                internalMaximumSize = new Size2D(OnMaximumSizeChanged, 0, 0);
+            }
+            Object.InternalRetrievingPropertyVector2(SwigCPtr, View.Property.MaximumSize, internalMaximumSize.SwigCPtr);
+            return internalMaximumSize;
         }
 
         internal int GetHierarchyDepth()
@@ -965,6 +1052,18 @@ namespace Tizen.NUI.BaseComponents
             return false;
         }
 
+        /// <summary>
+        /// Check whether Current view don't has BackgroundVisual or not.
+        /// Some API (like Animation, Borderline) required non-empty backgrounds.
+        /// </summary>
+        internal bool IsBackgroundEmpty()
+        {
+
+            int visualType = (int)Visual.Type.Invalid;
+            Interop.View.InternalRetrievingVisualPropertyInt(this.SwigCPtr, Property.BACKGROUND, Visual.Property.Type, out visualType);
+            return visualType == (int)Visual.Type.Invalid;
+        }
+
         internal void SetKeyInputFocus()
         {
             Interop.ViewInternal.SetKeyInputFocus(SwigCPtr);
@@ -1012,6 +1111,11 @@ namespace Tizen.NUI.BaseComponents
 
         internal void RemoveChild(View child)
         {
+            // If the view had focus, it clears focus.
+            if (child == FocusManager.Instance.GetCurrentFocusView())
+            {
+                FocusManager.Instance.ClearFocus();
+            }
             // Do actual child removal
             Interop.Actor.Remove(SwigCPtr, View.getCPtr(child));
             if (NDalicPINVOKE.SWIGPendingException.Pending)
@@ -1019,7 +1123,9 @@ namespace Tizen.NUI.BaseComponents
 
             Children.Remove(child);
             child.InternalParent = null;
+            LayoutCount -= child.LayoutCount;
 
+            OnChildRemoved(child);
             if (ChildRemoved != null)
             {
                 ChildRemovedEventArgs e = new ChildRemovedEventArgs
@@ -1035,6 +1141,8 @@ namespace Tizen.NUI.BaseComponents
         /// </summary>
         internal void ResetLayout()
         {
+            LayoutCount--;
+
             layout = null;
         }
 
@@ -1048,42 +1156,38 @@ namespace Tizen.NUI.BaseComponents
         {
             if (backgroundExtraData == null) return;
 
-            // Apply to the background visual
-            PropertyMap backgroundMap = new PropertyMap();
-            PropertyValue background = Tizen.NUI.Object.GetProperty(SwigCPtr, View.Property.BACKGROUND);
-            if (background.Get(backgroundMap) && !backgroundMap.Empty())
-            {
-                backgroundMap[Visual.Property.CornerRadius] = new PropertyValue(backgroundExtraData.CornerRadius);
-                backgroundMap[Visual.Property.CornerRadiusPolicy] = new PropertyValue((int)backgroundExtraData.CornerRadiusPolicy);
-                var temp = new PropertyValue(backgroundMap);
-                Tizen.NUI.Object.SetProperty(SwigCPtr, View.Property.BACKGROUND, temp);
-                temp.Dispose();
-            }
-            backgroundMap.Dispose();
-            background.Dispose();
 
-            // Apply to the shadow visual
-            PropertyMap shadowMap = new PropertyMap();
-            PropertyValue shadow = Tizen.NUI.Object.GetProperty(SwigCPtr, View.Property.SHADOW);
-            if (shadow.Get(shadowMap) && !shadowMap.Empty())
+            // Update corner radius properties to background and shadow by ActionUpdateProperty
+            if (backgroundExtraData.CornerRadius != null)
             {
-                shadowMap[Visual.Property.CornerRadius] = new PropertyValue(backgroundExtraData.CornerRadius);
-                shadowMap[Visual.Property.CornerRadiusPolicy] = new PropertyValue((int)backgroundExtraData.CornerRadiusPolicy);
-                var temp = new PropertyValue(shadowMap);
-                Tizen.NUI.Object.SetProperty(SwigCPtr, View.Property.SHADOW, temp);
-                temp.Dispose();
+                Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius));
+                Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerRadius, Vector4.getCPtr(backgroundExtraData.CornerRadius));
             }
-            shadowMap.Dispose();
-            shadow.Dispose();
+            Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
+            Interop.View.InternalUpdateVisualPropertyInt(this.SwigCPtr, View.Property.SHADOW, Visual.Property.CornerRadiusPolicy, (int)backgroundExtraData.CornerRadiusPolicy);
         }
 
-        internal void UpdateStyle()
+        /// TODO open as a protected level
+        internal virtual void ApplyBorderline()
         {
-            ViewStyle newStyle;
-            if (styleName == null) newStyle = ThemeManager.GetStyle(GetType());
-            else newStyle = ThemeManager.GetStyle(styleName);
+            if (backgroundExtraData == null) return;
 
-            if (newStyle != null && (viewStyle == null || viewStyle.GetType() == newStyle.GetType())) ApplyStyle(newStyle);
+
+            // ActionUpdateProperty works well only if BACKGROUND visual setup before.
+            // If view don't have BACKGROUND visual, we set transparent background color in default.
+            if (IsBackgroundEmpty())
+            {
+                // BACKGROUND visual doesn't exist.
+                SetBackgroundColor(Color.Transparent);
+                // SetBackgroundColor function apply borderline internally.
+                // So we can just return now.
+                return;
+            }
+
+            // Update borderline properties to background by ActionUpdateProperty
+            Interop.View.InternalUpdateVisualPropertyFloat(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.BorderlineWidth, backgroundExtraData.BorderlineWidth);
+            Interop.View.InternalUpdateVisualPropertyVector4(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.BorderlineColor, Vector4.getCPtr(backgroundExtraData.BorderlineColor ?? Color.Black));
+            Interop.View.InternalUpdateVisualPropertyFloat(this.SwigCPtr, View.Property.BACKGROUND, Visual.Property.BorderlineOffset, backgroundExtraData.BorderlineOffset);
         }
 
         /// <summary>
@@ -1101,6 +1205,18 @@ namespace Tizen.NUI.BaseComponents
             return value == null ? null : new Selector<T>(value);
         }
 
+        internal void SetThemeApplied()
+        {
+            if (themeData == null) themeData = new ThemeData();
+            themeData.ThemeApplied = true;
+
+            if (ThemeChangeSensitive && !themeData.ListeningThemeChangeEvent)
+            {
+                themeData.ListeningThemeChangeEvent = true;
+                ThemeManager.ThemeChangedInternal.Add(OnThemeChanged);
+            }
+        }
+
         /// <summary>
         /// you can override it to clean-up your own resources.
         /// </summary>
@@ -1113,33 +1229,117 @@ namespace Tizen.NUI.BaseComponents
                 return;
             }
 
+            disposeDebugging(type);
+
             //_mergedStyle = null;
 
+            internalMaximumSize?.Dispose();
+            internalMaximumSize = null;
+            internalMinimumSize?.Dispose();
+            internalMinimumSize = null;
+            internalMargin?.Dispose();
+            internalMargin = null;
+            internalPadding?.Dispose();
+            internalPadding = null;
+            internalSizeModeFactor?.Dispose();
+            internalSizeModeFactor = null;
+            internalCellIndex?.Dispose();
+            internalCellIndex = null;
+            internalBackgroundColor?.Dispose();
+            internalBackgroundColor = null;
+            internalColor?.Dispose();
+            internalColor = null;
+            internalPivotPoint?.Dispose();
+            internalPivotPoint = null;
+            internalPosition?.Dispose();
+            internalPosition = null;
+            internalPosition2D?.Dispose();
+            internalPosition2D = null;
+            internalScale?.Dispose();
+            internalScale = null;
+            internalSize?.Dispose();
+            internalSize = null;
+            internalSize2D?.Dispose();
+            internalSize2D = null;
+
+            panGestureDetector?.Dispose();
+            panGestureDetector = null;
+            longGestureDetector?.Dispose();
+            longGestureDetector = null;
+            pinchGestureDetector?.Dispose();
+            pinchGestureDetector = null;
+            tapGestureDetector?.Dispose();
+            tapGestureDetector = null;
+            rotationGestureDetector?.Dispose();
+            rotationGestureDetector = null;
+
+
+            internalCurrentParentOrigin?.Dispose();
+            internalCurrentParentOrigin = null;
+            internalCurrentAnchorPoint?.Dispose();
+            internalCurrentAnchorPoint = null;
+            internalTargetSize?.Dispose();
+            internalTargetSize = null;
+            internalCurrentSize?.Dispose();
+            internalCurrentSize = null;
+            internalCurrentPosition?.Dispose();
+            internalCurrentPosition = null;
+            internalCurrentWorldPosition?.Dispose();
+            internalCurrentWorldPosition = null;
+            internalCurrentScale?.Dispose();
+            internalCurrentScale = null;
+            internalCurrentWorldScale?.Dispose();
+            internalCurrentWorldScale = null;
+            internalCurrentColor?.Dispose();
+            internalCurrentColor = null;
+            internalCurrentWorldColor?.Dispose();
+            internalCurrentWorldColor = null;
+            internalSizeModeFactor?.Dispose();
+            internalSizeModeFactor = null;
+            internalCurrentScreenPosition?.Dispose();
+            internalCurrentScreenPosition = null;
+
             if (type == DisposeTypes.Explicit)
             {
                 //Called by User
                 //Release your own managed resources here.
                 //You should release all of your own disposable objects here.
-                selectorData?.Reset(this);
-                if (themeChangeSensitive)
+                if (themeData != null)
+                {
+                    themeData.selectorData?.Reset(this);
+                    if (themeData.ListeningThemeChangeEvent)
+                    {
+                        ThemeManager.ThemeChangedInternal.Remove(OnThemeChanged);
+                    }
+                }
+                if (widthConstraint != null)
+                {
+                    widthConstraint.Remove();
+                    widthConstraint.Dispose();
+                }
+                if (heightConstraint != null)
                 {
-                    ThemeManager.ThemeChangedInternal.Remove(OnThemeChanged);
+                    heightConstraint.Remove();
+                    heightConstraint.Dispose();
                 }
             }
 
             //Release your own unmanaged resources here.
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
-            if (this != null)
-            {
-                DisConnectFromSignals();
-            }
+
+            DisConnectFromSignals();
 
             foreach (View view in Children)
             {
                 view.InternalParent = null;
             }
 
+            LayoutCount = 0;
+
+            NUILog.Debug($"[Dispose] View.Dispose({type}) END");
+            NUILog.Debug($"=============================");
+
             base.Dispose(type);
         }
 
@@ -1181,119 +1381,211 @@ namespace Tizen.NUI.BaseComponents
             return false;
         }
 
-        private void DisConnectFromSignals()
+        /// <summary>
+        /// Internal callback of enabled property changes.
+        /// Inherited view can override this method to implements enabled property changes.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual void OnEnabled(bool enabled)
         {
-            // Save current CPtr.
-            global::System.Runtime.InteropServices.HandleRef currentCPtr = SwigCPtr;
+            if (enabled)
+            {
+                if (State == View.States.Disabled)
+                {
+                    State = View.States.Normal;
+                }
+                if (enableControlState)
+                {
+                    ControlState -= ControlState.Disabled;
+                }
+            }
+            else
+            {
+                State = View.States.Disabled;
+                if (enableControlState)
+                {
+                    ControlState += ControlState.Disabled;
+                }
+            }
+        }
 
-            // Use BaseHandle CPtr as current might have been deleted already in derived classes.
-            SwigCPtr = GetBaseHandleCPtrHandleRef;
+
+        private void DisConnectFromSignals()
+        {
+            if (HasBody() == false)
+            {
+                NUILog.Debug($"[Dispose] DisConnectFromSignals() No native body! No need to Disconnect Signals!");
+                return;
+            }
+            NUILog.Debug($"[Dispose] DisConnectFromSignals START");
+            NUILog.Debug($"[Dispose] View.DisConnectFromSignals() type:{GetType()} copyNativeHandle:{GetBaseHandleCPtrHandleRef.Handle.ToString("X8")}");
+            NUILog.Debug($"[Dispose] ID:{Interop.Actor.GetId(GetBaseHandleCPtrHandleRef)} Name:{Interop.Actor.GetName(GetBaseHandleCPtrHandleRef)}");
 
             if (onRelayoutEventCallback != null)
             {
-                ViewSignal signal = this.OnRelayoutSignal();
-                signal?.Disconnect(onRelayoutEventCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] onRelayoutEventCallback");
+
+                Interop.ActorSignal.OnRelayoutDisconnect(GetBaseHandleCPtrHandleRef, onRelayoutEventCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
                 onRelayoutEventCallback = null;
             }
 
             if (offWindowEventCallback != null)
             {
-                ViewSignal signal = this.OffWindowSignal();
-                signal?.Disconnect(offWindowEventCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] offWindowEventCallback");
+
+                Interop.ActorSignal.OffSceneDisconnect(GetBaseHandleCPtrHandleRef, offWindowEventCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
                 offWindowEventCallback = null;
             }
 
             if (onWindowEventCallback != null)
             {
-                ViewSignal signal = this.OnWindowSignal();
-                signal?.Disconnect(onWindowEventCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] onWindowEventCallback");
+
+                Interop.ActorSignal.OnSceneDisconnect(GetBaseHandleCPtrHandleRef, onWindowEventCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
                 onWindowEventCallback = null;
             }
 
-            if (wheelEventCallback != null)
+            if (interceptWheelCallback != null)
             {
-                WheelSignal signal = this.WheelEventSignal();
-                signal?.Disconnect(wheelEventCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] interceptWheelCallback");
+
+                Interop.ActorSignal.InterceptWheelDisconnect(GetBaseHandleCPtrHandleRef, interceptWheelCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                interceptWheelCallback = null;
             }
 
-            if (WindowWheelEventHandler != null)
+            if (wheelEventCallback != null)
             {
-                NUIApplication.GetDefaultWindow().WheelEvent -= OnWindowWheelEvent;
+                NUILog.Debug($"[Dispose] wheelEventCallback");
+
+                Interop.ActorSignal.WheelEventDisconnect(GetBaseHandleCPtrHandleRef, wheelEventCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                wheelEventCallback = null;
             }
 
             if (hoverEventCallback != null)
             {
-                HoverSignal signal = this.HoveredSignal();
-                signal?.Disconnect(hoverEventCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] hoverEventCallback");
+
+                Interop.ActorSignal.HoveredDisconnect(GetBaseHandleCPtrHandleRef, hoverEventCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                hoverEventCallback = null;
+            }
+
+            if (hitTestResultDataCallback != null)
+            {
+                NUILog.Debug($"[Dispose] hitTestResultDataCallback");
+
+                Interop.ActorSignal.HitTestResultDisconnect(GetBaseHandleCPtrHandleRef, hitTestResultDataCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                hitTestResultDataCallback = null;
             }
 
+
             if (interceptTouchDataCallback != null)
             {
-                TouchDataSignal signal = this.InterceptTouchSignal();
-                signal?.Disconnect(interceptTouchDataCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] interceptTouchDataCallback");
+
+                Interop.ActorSignal.InterceptTouchDisconnect(GetBaseHandleCPtrHandleRef, interceptTouchDataCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                interceptTouchDataCallback = null;
             }
 
             if (touchDataCallback != null)
             {
-                TouchDataSignal signal = this.TouchSignal();
-                signal?.Disconnect(touchDataCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] touchDataCallback");
+
+                Interop.ActorSignal.TouchDisconnect(GetBaseHandleCPtrHandleRef, touchDataCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                touchDataCallback = null;
             }
 
-            if (ResourcesLoadedCallback != null)
+            if (resourcesLoadedCallback != null)
             {
-                ViewSignal signal = this.ResourcesLoadedSignal();
-                signal?.Disconnect(ResourcesLoadedCallback);
-                signal?.Dispose();
-                ResourcesLoadedCallback = null;
+                NUILog.Debug($"[Dispose] ResourcesLoadedCallback");
+
+                Interop.ViewSignal.ResourceReadyDisconnect(GetBaseHandleCPtrHandleRef, resourcesLoadedCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                resourcesLoadedCallback = null;
             }
 
             if (keyCallback != null)
             {
-                ControlKeySignal signal = this.KeyEventSignal();
-                signal?.Disconnect(keyCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] keyCallback");
+
+                Interop.ViewSignal.KeyEventDisconnect(GetBaseHandleCPtrHandleRef, keyCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                keyCallback = null;
             }
 
             if (keyInputFocusLostCallback != null)
             {
-                KeyInputFocusSignal signal = this.KeyInputFocusLostSignal();
-                signal?.Disconnect(keyInputFocusLostCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] keyInputFocusLostCallback");
+
+                Interop.ViewSignal.KeyInputFocusLostDisconnect(GetBaseHandleCPtrHandleRef, keyInputFocusLostCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                keyInputFocusLostCallback = null;
+                keyInputFocusLostEventHandler = null;
             }
 
             if (keyInputFocusGainedCallback != null)
             {
-                KeyInputFocusSignal signal = this.KeyInputFocusGainedSignal();
-                signal?.Disconnect(keyInputFocusGainedCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] keyInputFocusGainedCallback");
+
+                Interop.ViewSignal.KeyInputFocusGainedDisconnect(GetBaseHandleCPtrHandleRef, keyInputFocusGainedCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
+                keyInputFocusGainedCallback = null;
+                keyInputFocusGainedEventHandler = null;
             }
 
             if (backgroundResourceLoadedCallback != null)
             {
-                ViewSignal signal = this.ResourcesLoadedSignal();
-                signal?.Disconnect(backgroundResourceLoadedCallback);
-                signal?.Dispose();
+                NUILog.Debug($"[Dispose] backgroundResourceLoadedCallback");
+
+                Interop.ViewSignal.ResourceReadyDisconnect(GetBaseHandleCPtrHandleRef, backgroundResourceLoadedCallback.ToHandleRef(this));
+                NDalicPINVOKE.ThrowExceptionIfExistsDebug();
                 backgroundResourceLoadedCallback = null;
             }
 
-            if (onWindowSendEventCallback != null)
+            NDalicPINVOKE.ThrowExceptionIfExists();
+            NUILog.Debug($"[Dispose] DisConnectFromSignals END");
+        }
+
+        /// <summary>
+        /// Apply initial style to the view.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual void InitializeStyle(ViewStyle style = null)
+        {
+            if (style == null && ThemeManager.InitialThemeDisabled)
+            {
+                // Fast return in most TV cases.
+                return;
+            }
+
+            var initialStyle = ThemeManager.GetInitialStyleWithoutClone(GetType());
+            if (style == null)
             {
-                ViewSignal signal = this.OnWindowSignal();
-                signal?.Disconnect(onWindowSendEventCallback);
-                signal?.Dispose();
-                onWindowSendEventCallback = null;
+                ApplyStyle(initialStyle);
+            }
+            else
+            {
+                var refinedStyle = style;
+                if (style.IncludeDefaultStyle)
+                {
+                    refinedStyle = initialStyle?.Merge(style);
+                }
+                ApplyStyle(refinedStyle);
             }
 
-            // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
-            // Restore current CPtr.
-            SwigCPtr = currentCPtr;
+            // Listen theme change event if needs.
+            if (initialStyle != null)
+            {
+                SetThemeApplied();
+            }
         }
 
         private View ConvertIdToView(uint id)
@@ -1338,11 +1630,6 @@ namespace Tizen.NUI.BaseComponents
             Margin = new Extents(start, end, top, bottom);
         }
 
-        private void OnColorChanged(float r, float g, float b, float a)
-        {
-            Color = new Color(r, g, b, a);
-        }
-
         private void OnAnchorPointChanged(float x, float y, float z)
         {
             AnchorPoint = new Position(x, y, z);
@@ -1373,12 +1660,33 @@ namespace Tizen.NUI.BaseComponents
             return false;
         }
 
-        private void InitializeStyle(ViewStyle style)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected virtual bool CheckResourceReady()
+        {
+            return true;
+        }
+
+        private ViewSelectorData EnsureSelectorData()
+        {
+            if (themeData == null) themeData = new ThemeData();
+
+            return themeData.selectorData ?? (themeData.selectorData = new ViewSelectorData());
+        }
+
+        [Conditional("NUI_DISPOSE_DEBUG_ON")]
+        private void disposeDebugging(DisposeTypes type)
         {
-            if (style != null) ApplyStyle(style.Clone());   // Use given style
-            else if (ThemeManager.ThemeApplied) UpdateStyle(); // Use style in the current theme
+            DebugFileLogging.Instance.WriteLog($"View.Dispose({type}) START");
+            DebugFileLogging.Instance.WriteLog($"type:{GetType()} copyNativeHandle:{GetBaseHandleCPtrHandleRef.Handle.ToString("X8")}");
+            if (HasBody())
+            {
+                DebugFileLogging.Instance.WriteLog($"ID:{Interop.Actor.GetId(GetBaseHandleCPtrHandleRef)} Name:{Interop.Actor.GetName(GetBaseHandleCPtrHandleRef)}");
+            }
+            else
+            {
+                DebugFileLogging.Instance.WriteLog($"has no native body!");
+            }
         }
 
-        private ViewSelectorData EnsureSelectorData() => selectorData ?? (selectorData = new ViewSelectorData());
     }
 }