Modify dispose issue for window
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Window.cs
index 717ca1f..9bd4af2 100755 (executable)
  * limitations under the License.
  *
  */
-using System;
-using System.Runtime.InteropServices;
-using Tizen.NUI.BaseComponents;
+
+extern alias TizenSystemInformation;
+using TizenSystemInformation.Tizen.System;
+using global::System;
 using System.ComponentModel;
 using System.Collections.Generic;
+using global::System.Runtime.InteropServices;
+using Tizen.NUI.BaseComponents;
 
 namespace Tizen.NUI
 {
@@ -27,352 +30,73 @@ namespace Tizen.NUI
     /// The window has an orientation and indicator properties.<br />
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
-    public class Window : BaseHandle
+    public partial class Window : BaseHandle
     {
-        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        private static readonly Window instance = Application.Instance?.GetWindow();
         private global::System.Runtime.InteropServices.HandleRef stageCPtr;
-        private readonly global::System.Runtime.InteropServices.HandleRef rootLayoutCPtr;
         private Layer _rootLayer;
         private string _windowTitle;
-        private readonly LayoutItem rootLayoutItem;
-
         private List<Layer> _childLayers = new List<Layer>();
-        private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
-        private RootLayerTouchDataCallbackType _rootLayerTouchDataCallback;
-        private WheelEventCallbackType _wheelEventCallback;
-        private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
-        private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
-        private EventHandler _stageContextLostEventHandler;
-        private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
-        private EventHandler _stageContextRegainedEventHandler;
-        private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
-        private EventHandler _stageSceneCreatedEventHandler;
-        private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
-        private WindowResizedEventCallbackType _windowResizedEventCallback;
-        private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
-
-        private static readonly Window instance = Application.Instance?.GetWindow();
-
         private LayoutController localController;
 
-        internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
-        {
-            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
-            if (NDalicPINVOKE.Stage_IsInstalled())
-            {
-                stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
-
-                localController = new LayoutController();
-                NUILog.Debug("layoutController id:" + localController.GetId() );
-
-                // Create a root layout (AbsoluteLayout) that is invisible to the user but enables layouts added to the Window
-                // Enables layouts added to the Window to have a parent layout.  As parent layout is needed to store measure spec properties.
-                // Currently without these measure specs the new layout added will always be the size of the window.
-                global::System.IntPtr rootLayoutIntPtr = NDalicManualPINVOKE.Window_NewRootLayout();
-                // Store HandleRef used by Add()
-                rootLayoutCPtr = new global::System.Runtime.InteropServices.HandleRef(this, rootLayoutIntPtr);
-                Layer rootLayer = GetRootLayer();
-                // Add the root layout created above to the root layer.
-                NDalicPINVOKE.Actor_Add(  Layer.getCPtr(rootLayer), rootLayoutCPtr );
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
-                global::System.IntPtr rootControlLayoutIntPtr = Tizen.NUI.NDalicManualPINVOKE.GetLayout__SWIG_1(rootLayoutCPtr);
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
-                rootLayoutItem = new LayoutItem(rootControlLayoutIntPtr, true);
-            }
-        }
-
-        internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
-        {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
-        {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
-        {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
-        {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
-        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate bool RootLayerTouchDataCallbackType(IntPtr view, IntPtr touchData);
-        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent);
-        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
-        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate void WindowFocusChangedEventCallbackType2(bool focusGained);
-
-        /// <summary>
-        /// FocusChanged event.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public event EventHandler<FocusChangedEventArgs> FocusChanged
-        {
-            add
-            {
-                if (_windowFocusChangedEventHandler == null)
-                {
-                    _windowFocusChangedEventCallback = OnWindowFocusedChanged;
-                    WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
-                }
-
-                _windowFocusChangedEventHandler += value;
-            }
-            remove
-            {
-                _windowFocusChangedEventHandler -= value;
-
-                if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
-                {
-                    WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
-                }
-            }
-        }
-
-        /// <summary>
-        /// This event is emitted when the screen is touched and when the touch ends.<br />
-        /// If there are multiple touch points, then this will be emitted when the first touch occurs and
-        /// then when the last finger is lifted.<br />
-        /// An interrupted event will also be emitted (if it occurs).<br />
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public event EventHandler<TouchEventArgs> TouchEvent
+        private bool IsSupportedMultiWindow()
         {
-            add
-            {
-                if (_rootLayerTouchDataEventHandler == null)
-                {
-                    _rootLayerTouchDataCallback = OnWindowTouch;
-                    this.TouchDataSignal().Connect(_rootLayerTouchDataCallback);
-                }
-                _rootLayerTouchDataEventHandler += value;
-            }
-            remove
-            {
-                _rootLayerTouchDataEventHandler -= value;
-                if (_rootLayerTouchDataEventHandler == null && TouchSignal().Empty() == false)
-                {
-                    this.TouchDataSignal().Disconnect(_rootLayerTouchDataCallback);
-                }
-            }
+            bool isSupported = false;
+            Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSupported);
+            return isSupported;
         }
 
-        /// <summary>
-        /// This event is emitted when the wheel event is received.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public event EventHandler<WheelEventArgs> WheelEvent
+        internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Window.Upcast(cPtr), cMemoryOwn)
         {
-            add
+            if (Interop.Stage.IsInstalled())
             {
-                if (_stageWheelHandler == null)
-                {
-                    _wheelEventCallback = OnStageWheel;
-                    this.StageWheelEventSignal().Connect(_wheelEventCallback);
-                }
-                _stageWheelHandler += value;
-            }
-            remove
-            {
-                _stageWheelHandler -= value;
-                if (_stageWheelHandler == null && StageWheelEventSignal().Empty() == false)
-                {
-                    this.StageWheelEventSignal().Disconnect(_wheelEventCallback);
-                }
-            }
-        }
+                stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.GetCurrent());
 
-        /// <summary>
-        /// This event is emitted when the key event is received.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public event EventHandler<KeyEventArgs> KeyEvent
-        {
-            add
-            {
-                if (_stageKeyHandler == null)
-                {
-                    _stageKeyCallbackDelegate = OnStageKey;
-                    KeyEventSignal().Connect(_stageKeyCallbackDelegate);
-                }
-                _stageKeyHandler += value;
-            }
-            remove
-            {
-                _stageKeyHandler -= value;
-                if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
-                {
-                    KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
-                }
+                localController = new LayoutController(this);
+                NUILog.Debug("layoutController id:" + localController.GetId());
             }
         }
 
         /// <summary>
-        /// This event is emitted when the window resized.
+        /// Creates a new Window.<br />
+        /// This creates an extra window in addition to the default main window<br />
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public event EventHandler<ResizedEventArgs> Resized
+        /// <param name="windowPosition">The position and size of the Window.</param>
+        /// <param name="isTranslucent">Whether Window is translucent.</param>
+        /// <returns>A new Window.</returns>
+        /// <since_tizen> 6 </since_tizen>
+        /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        public Window(Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
         {
-            add
-            {
-                if (_windowResizedEventHandler == null)
-                {
-                    _windowResizedEventCallback = OnResized;
-                    ResizedSignal().Connect(_windowResizedEventCallback);
-                }
-
-                _windowResizedEventHandler += value;
-            }
-            remove
+            if (IsSupportedMultiWindow() == false)
             {
-                _windowResizedEventHandler -= value;
-
-                if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
-                {
-                    ResizedSignal().Disconnect(_windowResizedEventCallback);
-                }
+                NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
             }
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
         /// <summary>
-        /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead.
+        /// Creates a new Window with a specific name.<br />
+        /// This creates an extra window in addition to the default main window<br />
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        /// Please do not use! this will be deprecated!
-        /// Instead please use FocusChanged.
-        [Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " +
-            "Like: " +
-            "Window.Instance.FocusChanged = OnFocusChanged; " +
-            "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public event EventHandler<FocusChangedEventArgs> WindowFocusChanged
-        {
-            add
-            {
-                if (_windowFocusChangedEventHandler2 == null)
-                {
-                    _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2;
-                    WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2);
-                }
-
-                _windowFocusChangedEventHandler2 += value;
-            }
-            remove
-            {
-                _windowFocusChangedEventHandler2 -= value;
-
-                if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null)
-                {
-                    WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
-                }
-            }
-        }
-
-        internal event EventHandler EventProcessingFinished
-        {
-            add
-            {
-                if (_stageEventProcessingFinishedEventHandler == null)
-                {
-                    _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
-                    EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
-                }
-                _stageEventProcessingFinishedEventHandler += value;
-
-            }
-            remove
-            {
-                _stageEventProcessingFinishedEventHandler -= value;
-                if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
-                {
-                    EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
-                }
-            }
-        }
-
-        internal event EventHandler ContextLost
-        {
-            add
-            {
-                if (_stageContextLostEventHandler == null)
-                {
-                    _stageContextLostEventCallbackDelegate = OnContextLost;
-                    ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
-                }
-                _stageContextLostEventHandler += value;
-            }
-            remove
-            {
-                _stageContextLostEventHandler -= value;
-                if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
-                {
-                    ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
-                }
-            }
-        }
-
-        internal event EventHandler ContextRegained
-        {
-            add
-            {
-                if (_stageContextRegainedEventHandler == null)
-                {
-                    _stageContextRegainedEventCallbackDelegate = OnContextRegained;
-                    ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
-                }
-                _stageContextRegainedEventHandler += value;
-            }
-            remove
-            {
-                _stageContextRegainedEventHandler -= value;
-                if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
-                {
-                    this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
-                }
-            }
-        }
-
-        internal event EventHandler SceneCreated
+        /// <param name="name">The name for extra window. </param>
+        /// <param name="windowPosition">The position and size of the Window.</param>
+        /// <param name="isTranslucent">Whether Window is translucent.</param>
+        /// <returns>A new Window.</returns>
+        /// <since_tizen> 6 </since_tizen>
+        /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.New(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
         {
-            add
-            {
-                if (_stageSceneCreatedEventHandler == null)
-                {
-                    _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
-                    SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
-                }
-                _stageSceneCreatedEventHandler += value;
-            }
-            remove
+            if (IsSupportedMultiWindow() == false)
             {
-                _stageSceneCreatedEventHandler -= value;
-                if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
-                {
-                    SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
-                }
+                NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
             }
+            this._windowTitle = name;
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler;
-        private event EventHandler<TouchEventArgs> _rootLayerTouchDataEventHandler;
-        private event EventHandler<WheelEventArgs> _stageWheelHandler;
-        private event EventHandler<KeyEventArgs> _stageKeyHandler;
-        private event EventHandler _stageEventProcessingFinishedEventHandler;
-        private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
-        private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler2;
-
         /// <summary>
         /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
         /// </summary>
@@ -398,7 +122,14 @@ namespace Tizen.NUI
             /// Landscape inverse orientation.
             /// </summary>
             /// <since_tizen> 3 </since_tizen>
-            LandscapeInverse = 270
+            LandscapeInverse = 270,
+            /// <summary>
+            /// No orientation. It is for the preferred orientation
+            /// Especially, NoOrientationPreference only has the effect for the preferred orientation.
+            /// It is used to unset the preferred orientation with SetPreferredOrientation.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            NoOrientationPreference = -1
         }
 
         /// <summary>
@@ -426,23 +157,103 @@ namespace Tizen.NUI
         };
 
         /// <summary>
-        /// Enumeration for opacity of the indicator.
+        /// Enumeration for transition effect's state.
+        /// </summary>
+        [Obsolete("Please do not use! This will be removed. Please use Window.EffectState instead!")]
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum EffectStates
+        {
+            /// <summary>
+            /// None state.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.None instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            None = 0,
+            /// <summary>
+            /// Transition effect is started.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.Start instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Start,
+            /// <summary>
+            /// Transition effect is ended.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectState.End instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            End,
+        }
+
+        /// <summary>
+        /// Enumeration for transition effect's state.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum EffectState
+        {
+            /// <summary>
+            /// None state.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            None = 0,
+            /// <summary>
+            /// Transition effect is started.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Start,
+            /// <summary>
+            /// Transition effect is ended.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            End,
+        }
+
+        /// <summary>
+        /// Enumeration for transition effect's type.
         /// </summary>
-        internal enum IndicatorBackgroundOpacity
+        [Obsolete("Please do not use! This will be removed. Please use Window.EffectType instead!")]
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum EffectTypes
         {
-            Opaque = 100,
-            Translucent = 50,
-            Transparent = 0
+            /// <summary>
+            /// None type.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.None instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            None = 0,
+            /// <summary>
+            /// Window show effect.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Show instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Show,
+            /// <summary>
+            /// Window hide effect.
+            /// </summary>
+            [Obsolete("Please do not use! This will be removed. Please use Window.EffectType.Hide instead!")]
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Hide,
         }
 
         /// <summary>
-        /// Enumeration for visible mode of the indicator.
+        /// Enumeration for transition effect's type.
         /// </summary>
-        internal enum IndicatorVisibleMode
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public enum EffectType
         {
-            Invisible = 0,
-            Visible = 1,
-            Auto = 2
+            /// <summary>
+            /// None type.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            None = 0,
+            /// <summary>
+            /// Window show effect.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Show,
+            /// <summary>
+            /// Window hide effect.
+            /// </summary>
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            Hide,
         }
 
         /// <summary>
@@ -466,13 +277,13 @@ namespace Tizen.NUI
         {
             get
             {
-                WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                WindowType ret = (WindowType)Interop.Window.GetType(SwigCPtr);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
                 return ret;
             }
             set
             {
-                NDalicPINVOKE.SetType(swigCPtr, (int)value);
+                Interop.Window.SetType(SwigCPtr, (int)value);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
         }
@@ -569,6 +380,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Gets or sets a size of the window.
         /// </summary>
+        /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
         /// <since_tizen> 4 </since_tizen>
         public Size2D WindowSize
         {
@@ -585,6 +397,7 @@ namespace Tizen.NUI
         /// <summary>
         /// Gets or sets a position of the window.
         /// </summary>
+        /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
         /// <since_tizen> 4 </since_tizen>
         public Position2D WindowPosition
         {
@@ -597,11 +410,33 @@ namespace Tizen.NUI
                 SetPosition(value);
             }
         }
+
+        /// <summary>
+        /// Sets position and size of the window. This API guarantees that
+        /// both moving and resizing of window will appear on the screen at once.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Rectangle WindowPositionSize
+        {
+            get
+            {
+                Position2D position = GetPosition();
+                Size2D size = GetSize();
+                Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
+                position.Dispose();
+                return ret;
+            }
+            set
+            {
+                SetPositionSize(value);
+            }
+        }
+
         internal static Vector4 DEFAULT_BACKGROUND_COLOR
         {
             get
             {
-                global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
+                global::System.IntPtr cPtr = Interop.Stage.DefaultBackgroundColorGet();
                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                 return ret;
@@ -612,7 +447,7 @@ namespace Tizen.NUI
         {
             get
             {
-                global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
+                global::System.IntPtr cPtr = Interop.Stage.DebugBackgroundColorGet();
                 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                 return ret;
@@ -628,6 +463,17 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        ///  Get the LayoutController for this Window.
+        /// </summary>
+        internal LayoutController LayoutController
+        {
+            get
+            {
+                return localController;
+            }
+        }
+
+        /// <summary>
         /// Feed a key-event into the window.
         /// </summary>
         /// <param name="keyEvent">The key event to feed.</param>
@@ -635,7 +481,7 @@ namespace Tizen.NUI
         [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
         public static void FeedKeyEvent(Key keyEvent)
         {
-            NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
+            Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -646,7 +492,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void SetAcceptFocus(bool accept)
         {
-            NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
+            Interop.Window.SetAcceptFocus(SwigCPtr, accept);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -657,7 +503,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool IsFocusAcceptable()
         {
-            bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
+            bool ret = Interop.Window.IsFocusAcceptable(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
             return ret;
@@ -669,7 +515,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void Show()
         {
-            NDalicPINVOKE.Show(swigCPtr);
+            Interop.Window.Show(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -679,7 +525,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void Hide()
         {
-            NDalicPINVOKE.Hide(swigCPtr);
+            Interop.Window.Hide(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -690,7 +536,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool IsVisible()
         {
-            bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
+            bool temp = Interop.Window.IsVisible(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return temp;
         }
@@ -702,7 +548,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public uint GetSupportedAuxiliaryHintCount()
         {
-            uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
+            uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -715,7 +561,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public string GetSupportedAuxiliaryHint(uint index)
         {
-            string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
+            string ret = Interop.Window.GetSupportedAuxiliaryHint(SwigCPtr, index);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -729,7 +575,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public uint AddAuxiliaryHint(string hint, string value)
         {
-            uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
+            uint ret = Interop.Window.AddAuxiliaryHint(SwigCPtr, hint, value);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -742,7 +588,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool RemoveAuxiliaryHint(uint id)
         {
-            bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
+            bool ret = Interop.Window.RemoveAuxiliaryHint(SwigCPtr, id);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -756,7 +602,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool SetAuxiliaryHintValue(uint id, string value)
         {
-            bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
+            bool ret = Interop.Window.SetAuxiliaryHintValue(SwigCPtr, id, value);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -769,7 +615,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public string GetAuxiliaryHintValue(uint id)
         {
-            string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
+            string ret = Interop.Window.GetAuxiliaryHintValue(SwigCPtr, id);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -782,7 +628,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public uint GetAuxiliaryHintId(string hint)
         {
-            uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
+            uint ret = Interop.Window.GetAuxiliaryHintId(SwigCPtr, hint);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -794,7 +640,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void SetInputRegion(Rectangle inputRegion)
         {
-            NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
+            Interop.Window.SetInputRegion(SwigCPtr, Rectangle.getCPtr(inputRegion));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -806,7 +652,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool SetNotificationLevel(NotificationLevel level)
         {
-            bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
+            bool ret = Interop.Window.SetNotificationLevel(SwigCPtr, (int)level);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -818,7 +664,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public NotificationLevel GetNotificationLevel()
         {
-            NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
+            NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -835,7 +681,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void SetOpaqueState(bool opaque)
         {
-            NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
+            Interop.Window.SetOpaqueState(SwigCPtr, opaque);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -847,7 +693,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool IsOpaqueState()
         {
-            bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
+            bool ret = Interop.Window.IsOpaqueState(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -860,7 +706,7 @@ namespace Tizen.NUI
         /// <since_tizen> 4 </since_tizen>
         public bool SetScreenOffMode(ScreenOffMode screenOffMode)
         {
-            bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode);
+            bool ret = Interop.Window.SetScreenOffMode(SwigCPtr, (int)screenOffMode);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -872,7 +718,7 @@ namespace Tizen.NUI
         /// <since_tizen> 4 </since_tizen>
         public ScreenOffMode GetScreenOffMode()
         {
-            ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr);
+            ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -885,7 +731,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool SetBrightness(int brightness)
         {
-            bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
+            bool ret = Interop.Window.SetBrightness(SwigCPtr, brightness);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -897,7 +743,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public int GetBrightness()
         {
-            int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
+            int ret = Interop.Window.GetBrightness(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -910,7 +756,7 @@ namespace Tizen.NUI
         /// <since_tizen> 4 </since_tizen>
         public void SetClass(string name, string klass)
         {
-            NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
+            Interop.Window.SetClass(SwigCPtr, name, klass);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -920,7 +766,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void Raise()
         {
-            NDalicPINVOKE.Window_Raise(swigCPtr);
+            Interop.Window.Raise(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -930,7 +776,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void Lower()
         {
-            NDalicPINVOKE.Window_Lower(swigCPtr);
+            Interop.Window.Lower(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -940,7 +786,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void Activate()
         {
-            NDalicPINVOKE.Window_Activate(swigCPtr);
+            Interop.Window.Activate(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -961,10 +807,13 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void Add(View view)
         {
-            NDalicPINVOKE.Actor_Add(rootLayoutCPtr, View.getCPtr(view));
+            Interop.Actor.Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
-            view.InternalParent = this.GetRootLayer();
+            if (null != view)
+            {
+                view.InternalParent = this.GetRootLayer();
+            }
         }
 
         /// <summary>
@@ -974,9 +823,12 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public void Remove(View view)
         {
-            NDalicPINVOKE.Actor_Remove(rootLayoutCPtr, View.getCPtr(view));
+            Interop.Actor.Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
             this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
-            view.InternalParent = null;
+            if (null != view)
+            {
+                view.InternalParent = null;
+            }
         }
 
         /// <summary>
@@ -999,13 +851,22 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Destroy the window immediately.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void Destroy()
+        {
+            this.Dispose();
+        }
+
+        /// <summary>
         /// Keep rendering for at least the given amount of time.
         /// </summary>
         /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
         /// <since_tizen> 3 </since_tizen>
         public void KeepRendering(float durationSeconds)
         {
-            NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
+            Interop.Stage.KeepRendering(stageCPtr, durationSeconds);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -1019,7 +880,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool GrabKeyTopmost(int DaliKey)
         {
-            bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
+            bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1033,7 +894,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool UngrabKeyTopmost(int DaliKey)
         {
-            bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
+            bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1051,7 +912,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
         {
-            bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
+            bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey, (int)GrabMode);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1065,7 +926,7 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         public bool UngrabKey(int DaliKey)
         {
-            bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
+            bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.SwigCPtr), DaliKey);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1079,7 +940,7 @@ namespace Tizen.NUI
         /// <since_tizen> 5 </since_tizen>
         public bool SetKeyboardRepeatInfo(float rate, float delay)
         {
-            bool ret = NDalicManualPINVOKE.SetKeyboardRepeatInfo(rate, delay);
+            bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1093,7 +954,7 @@ namespace Tizen.NUI
         /// <since_tizen> 5 </since_tizen>
         public bool GetKeyboardRepeatInfo(out float rate, out float delay)
         {
-            bool ret = NDalicManualPINVOKE.GetKeyboardRepeatInfo(out rate, out delay);
+            bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1102,26 +963,22 @@ namespace Tizen.NUI
         /// Adds a layer to the stage.
         /// </summary>
         /// <param name="layer">Layer to add.</param>
+        /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
         /// <since_tizen> 3 </since_tizen>
         public void AddLayer(Layer layer)
         {
-            NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
-            LayersChildren?.Add(layer);
+            Add(layer);
         }
 
         /// <summary>
         /// Removes a layer from the stage.
         /// </summary>
         /// <param name="layer">Layer to remove.</param>
+        /// <exception cref="ArgumentNullException"> Thrown when layer is null. </exception>
         /// <since_tizen> 3 </since_tizen>
         public void RemoveLayer(Layer layer)
         {
-            NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
-            LayersChildren?.Remove(layer);
+            Remove(layer);
         }
 
         /// <summary>
@@ -1131,7 +988,7 @@ namespace Tizen.NUI
         /// <since_tizen> 5 </since_tizen>
         public void FeedKey(Key keyEvent)
         {
-            NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
+            Interop.Window.FeedKeyEvent(Key.getCPtr(keyEvent));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
@@ -1142,126 +999,244 @@ namespace Tizen.NUI
         /// <since_tizen> 4 </since_tizen>
         public void RenderOnce()
         {
-            NDalicManualPINVOKE.Window_RenderOnce(swigCPtr);
+            Interop.Window.RenderOnce(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
+        /// <summary>
+        /// Sets whether the window is transparent or not.
+        /// </summary>
+        /// <param name="transparent">Whether the window is transparent or not.</param>
+        /// <since_tizen> 5 </since_tizen>
+        public void SetTransparency(bool transparent)
         {
-            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+            Interop.Window.SetTransparency(SwigCPtr, transparent);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+            // Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
         }
 
-        internal static Window GetCurrent()
+        /// <summary>
+        /// Sets parent window of the window.
+        /// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
+        /// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
+        /// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
+        /// </summary>
+        /// <param name="parent">The parent window.</param>
+        /// <since_tizen> 6 </since_tizen>
+        /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        public void SetParent(Window parent)
         {
-            Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
+            if (IsSupportedMultiWindow() == false)
+            {
+                NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
+            }
+            Interop.Window.SetParent(SwigCPtr, Window.getCPtr(parent));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
         }
 
-        internal static bool IsInstalled()
+        /// <summary>
+        /// Unsets parent window of the window.
+        /// After unsetting, the window is disconnected his parent window.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        public void Unparent()
         {
-            bool ret = NDalicPINVOKE.Stage_IsInstalled();
+            if (IsSupportedMultiWindow() == false)
+            {
+                NUILog.Error("Fail to create window. because this device does not support opengles.surfaceless_context.");
+            }
+            Interop.Window.Unparent(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
         }
 
-        internal WindowFocusSignalType WindowFocusChangedSignal()
-        {
-            WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
+        /// <summary>
+        /// Gets parent window of the window.
+        /// </summary>
+        /// <returns>The parent window of the window.</returns>
+        /// <since_tizen> 6 </since_tizen>
+        /// <feature> http://tizen.org/feature/opengles.surfaceless_context </feature>
+        /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+        public Window GetParent()
+        {
+            if (IsSupportedMultiWindow() == false)
+            {
+                NUILog.Error("This device does not support surfaceless_context. So Window cannot be created. ");
+            }
+            Window ret = Registry.GetManagedBaseHandleFromNativePtr(Interop.Window.GetParent(SwigCPtr)) as Window;
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
+        /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void ObjectDump()
         {
-            NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            Layer rootLayer = GetRootLayer();
+            foreach (View view in rootLayer.Children)
+            {
+                view.ObjectDump();
+            }
         }
 
-        internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
         {
-            NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
         }
 
-        internal void RotateIndicator(Window.WindowOrientation orientation)
+        internal static bool IsInstalled()
         {
-            NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
+            bool ret = Interop.Stage.IsInstalled();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
         }
 
-        internal void AddAvailableOrientation(Window.WindowOrientation orientation)
+        /// <summary>
+        /// Adds an orientation to the list of available orientations.
+        /// </summary>
+        /// <param name="orientation">The available orientation to add</param>
+        /// <since_tizen> 6 </since_tizen>
+        public void AddAvailableOrientation(Window.WindowOrientation orientation)
         {
-            NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
+            Interop.Window.AddAvailableOrientation(SwigCPtr, (int)orientation);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
+        /// <summary>
+        /// Removes an orientation from the list of available orientations.
+        /// </summary>
+        /// <param name="orientation">The available orientation to remove.</param>
+        /// <since_tizen> 6 </since_tizen>
+        public void RemoveAvailableOrientation(Window.WindowOrientation orientation)
         {
-            NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
+            Interop.Window.RemoveAvailableOrientation(SwigCPtr, (int)orientation);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal void SetPreferredOrientation(Window.WindowOrientation orientation)
+        /// <summary>
+        /// Sets a preferred orientation.
+        /// </summary>
+        /// <param name="orientation">The preferred orientation.</param>
+        /// <since_tizen> 6 </since_tizen>
+        public void SetPreferredOrientation(Window.WindowOrientation orientation)
         {
-            NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
+            Interop.Window.SetPreferredOrientation(SwigCPtr, (int)orientation);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal Window.WindowOrientation GetPreferredOrientation()
+        /// <summary>
+        /// Gets the preferred orientation.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        /// <returns>The preferred orientation if previously set, or none.</returns>
+        public Window.WindowOrientation GetPreferredOrientation()
         {
-            Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
+            Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetPreferredOrientation(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        internal DragAndDropDetector GetDragAndDropDetector()
+        /// <summary>
+        /// Gets current orientation of the window.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        /// <returns>The current window orientation if previously set, or none.</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Window.WindowOrientation GetCurrentOrientation()
         {
-            DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
+            Window.WindowOrientation ret = (Window.WindowOrientation)Interop.Window.GetCurrentOrientation(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        internal Any GetNativeHandle()
+        /// <summary>
+        /// Sets available orientations of the window.
+        /// This API is for setting several orientations one time.
+        /// </summary>
+        /// <param name="orientations">The list of orientations.</param>
+        /// <since_tizen> 6 </since_tizen>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetAvailableOrientations(List<Window.WindowOrientation> orientations)
         {
-            Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
+            PropertyArray orientationArray = new PropertyArray();
+            if (null != orientations)
+            {
+                for (int i = 0; i < orientations.Count; i++)
+                {
+                    PropertyValue value = new PropertyValue((int)orientations[i]);
+                    orientationArray.PushBack(value);
+                }
+            }
+
+            Interop.Window.SetAvailableOrientations(SwigCPtr, PropertyArray.getCPtr(orientationArray));
+            for (uint i = 0; i < orientationArray.Count(); i++)
+            {
+                orientationArray[i].Dispose();
+            }
+            orientationArray.Dispose();
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Get native window ID
+        /// </summary>
+        /// <returns>native window ID</returns>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public int GetNativeId()
+        {
+            int ret = Interop.Window.GetNativeId(SwigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        internal WindowFocusSignalType FocusChangedSignal()
+        internal Any GetNativeHandle()
         {
-            WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
+            Any ret = new Any(Interop.WindowInternal.WindowGetNativeHandle(SwigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         internal void Add(Layer layer)
         {
-            NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
+            if (null == layer)
+            {
+                throw new ArgumentNullException(nameof(layer));
+            }
+            Interop.Window.Add(SwigCPtr, Layer.getCPtr(layer));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
             LayersChildren?.Add(layer);
+            layer.SetWindow(this);
         }
 
         internal void Remove(Layer layer)
         {
-            NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
+            if (null == layer)
+            {
+                throw new ArgumentNullException(nameof(layer));
+            }
+            Interop.Window.Remove(SwigCPtr, Layer.getCPtr(layer));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
             LayersChildren?.Remove(layer);
+            layer.SetWindow(null);
         }
 
         internal Vector2 GetSize()
         {
-            Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
+            var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), false);
+            Vector2 ret = new Vector2(val.GetWidth(), val.GetHeight());
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         internal RenderTaskList GetRenderTaskList()
         {
-            RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
+            RenderTaskList ret = new RenderTaskList(Interop.Stage.GetRenderTaskList(stageCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1276,7 +1251,7 @@ namespace Tizen.NUI
             if (LayersChildren == null || LayersChildren.Count < 0)
                 return 0;
 
-            return (uint) LayersChildren.Count;
+            return (uint)LayersChildren.Count;
         }
 
         internal Layer GetRootLayer()
@@ -1285,582 +1260,278 @@ namespace Tizen.NUI
             // Core has been initialized, not when Stage is ready.
             if (_rootLayer == null && Window.IsInstalled())
             {
-                _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
+                _rootLayer = new Layer(Interop.Window.GetRootLayer(SwigCPtr), true);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                 LayersChildren?.Add(_rootLayer);
+                _rootLayer.SetWindow(this);
             }
             return _rootLayer;
         }
 
         internal void SetBackgroundColor(Vector4 color)
         {
-            NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
+            Interop.Window.SetBackgroundColor(SwigCPtr, Vector4.getCPtr(color));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
         internal Vector4 GetBackgroundColor()
         {
-            Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
+            Vector4 ret = new Vector4(Interop.Window.GetBackgroundColor(SwigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         internal Vector2 GetDpi()
         {
-            Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
+            Vector2 ret = new Vector2(Interop.Stage.GetDpi(stageCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         internal ObjectRegistry GetObjectRegistry()
         {
-            ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
+            ObjectRegistry ret = new ObjectRegistry(Interop.Stage.GetObjectRegistry(stageCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
         {
-            NDalicPINVOKE.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
+            Interop.Stage.SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
         internal RenderingBehaviorType GetRenderingBehavior()
         {
-            RenderingBehaviorType ret = (RenderingBehaviorType)NDalicPINVOKE.Stage_GetRenderingBehavior(stageCPtr);
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        internal KeyEventSignal KeyEventSignal()
-        {
-            KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        internal VoidSignal EventProcessingFinishedSignal()
-        {
-            VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        internal TouchSignal TouchSignal()
-        {
-            TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        internal TouchDataSignal TouchDataSignal()
-        {
-            TouchDataSignal ret = new TouchDataSignal(NDalicPINVOKE.Actor_TouchSignal(Layer.getCPtr(GetRootLayer())), false);
+            RenderingBehaviorType ret = (RenderingBehaviorType)Interop.Stage.GetRenderingBehavior(stageCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        internal VoidSignal ContextLostSignal()
-        {
-            VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        internal VoidSignal ContextRegainedSignal()
-        {
-            VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        internal VoidSignal SceneCreatedSignal()
-        {
-            VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        internal ResizedSignal ResizedSignal()
-        {
-            ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
         internal void SetWindowSize(Size2D size)
         {
-            var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
-            NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val));
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
-            if(rootLayoutItem != null)
+            if (null == size)
             {
-                rootLayoutItem.RequestLayout();
+                throw new ArgumentNullException(nameof(size));
             }
+            var val = new Uint16Pair((uint)size.Width, (uint)size.Height);
+            Interop.Window.SetSize(SwigCPtr, Uint16Pair.getCPtr(val));
+            val.Dispose();
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            // Resetting Window size should request a relayout of the tree.
         }
 
         internal Size2D GetWindowSize()
         {
-            var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
+            var val = new Uint16Pair(Interop.Window.GetSize(SwigCPtr), false);
             Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         internal void SetPosition(Position2D position)
         {
-            var val = new Uint16Pair((uint)position.X, (uint)position.Y);
-            NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val));
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
-            if(rootLayoutItem != null)
+            if (null == position)
             {
-                rootLayoutItem.RequestLayout();
+                throw new ArgumentNullException(nameof(position));
             }
+            var val = new Uint16Pair((uint)position.X, (uint)position.Y);
+            Interop.Window.SetPosition(SwigCPtr, Uint16Pair.getCPtr(val));
+            val.Dispose();
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            // Setting Position of the window should request a relayout of the tree.
         }
 
         internal Position2D GetPosition()
         {
-            var val = new Uint16Pair(NDalicManualPINVOKE.GetPosition(swigCPtr), true);
+            var val = new Uint16Pair(Interop.Window.GetPosition(SwigCPtr), true);
             Position2D ret = new Position2D(val.GetX(), val.GetY());
-
+            val.Dispose();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         internal void SetPositionSize(Rectangle positionSize)
         {
-            NDalicPINVOKE.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize));
+            Interop.Window.SetPositionSize(SwigCPtr, Rectangle.getCPtr(positionSize));
 
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
-            if(rootLayoutItem != null)
-            {
-                rootLayoutItem.RequestLayout();
-            }
+            // Setting Position of the window should request a relayout of the tree.
         }
 
         /// <summary>
-        /// Sets whether the window is transparent or not.
+        /// Add FrameUpdateCallback
         /// </summary>
-        /// <param name="transparent">Whether the window is transparent or not.</param>
-        /// <since_tizen> 5 </since_tizen>
-        public void SetTransparency(bool transparent) {
-            NDalicManualPINVOKE.SetTransparency(swigCPtr, transparent);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
-            if(rootLayoutItem != null)
-            {
-                rootLayoutItem.RequestLayout();
-            }
-        }
-
-        internal System.IntPtr GetNativeWindowHandler()
-        {
-            System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        private void OnWindowFocusedChanged(bool focusGained)
-        {
-            FocusChangedEventArgs e = new FocusChangedEventArgs();
-
-            e.FocusGained = focusGained;
-
-            if (_windowFocusChangedEventHandler != null)
-            {
-                _windowFocusChangedEventHandler(this, e);
-            }
-        }
-
-        private StageWheelSignal WheelEventSignal()
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void AddFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
         {
-            StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            frameUpdateCallback?.AddFrameUpdateCallback(stageCPtr, Layer.getCPtr(GetRootLayer()));
         }
 
-        private WheelSignal StageWheelEventSignal()
+        /// <summary>
+        /// Remove FrameUpdateCallback
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void RemoveFrameUpdateCallback(FrameUpdateCallbackInterface frameUpdateCallback)
         {
-            WheelSignal ret = new WheelSignal(NDalicPINVOKE.Actor_WheelEventSignal(Layer.getCPtr(this.GetRootLayer())), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
+            frameUpdateCallback?.RemoveFrameUpdateCallback(stageCPtr);
         }
 
-        private bool OnWindowTouch(IntPtr view, IntPtr touchData)
+        /// <summary>
+        /// Dispose for Window
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override void Dispose(DisposeTypes type)
         {
-            if (touchData == global::System.IntPtr.Zero)
-            {
-                NUILog.Error("touchData should not be null!");
-                return false;
-            }
-
-            TouchEventArgs e = new TouchEventArgs();
-
-            e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
-
-            if (_rootLayerTouchDataEventHandler != null)
+            if (disposed)
             {
-                _rootLayerTouchDataEventHandler(this, e);
-            }
-            return false;
-        }
-
-        private bool OnStageWheel(IntPtr rootLayer, IntPtr wheelEvent)
-        {
-            if (wheelEvent == global::System.IntPtr.Zero)
-        {
-                NUILog.Error("wheelEvent should not be null!");
-                return true;
+                return;
             }
 
-            WheelEventArgs e = new WheelEventArgs();
-
-            e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
-
-            if (_stageWheelHandler != null)
+            if (type == DisposeTypes.Explicit)
             {
-                _stageWheelHandler(this, e);
-            }
-            return true;
-        }
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
 
-        // Callback for Stage KeyEventsignal
-        private void OnStageKey(IntPtr data)
-        {
-            KeyEventArgs e = new KeyEventArgs();
-            e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
+                if (_rootLayer != null)
+                {
+                    _rootLayer.Dispose();
+                }
 
+                localController?.Dispose();
 
-            if (_stageKeyHandler != null)
-            {
-                //here we send all data to user event handlers
-                _stageKeyHandler(this, e);
-            }
-        }
+                foreach (var layer in _childLayers)
+                {
+                    if (layer != null)
+                    {
+                        layer.Dispose();
+                    }
+                }
 
-        // Callback for Stage EventProcessingFinishedSignal
-        private void OnEventProcessingFinished()
-        {
-            if (_stageEventProcessingFinishedEventHandler != null)
-            {
-                _stageEventProcessingFinishedEventHandler(this, null);
+                _childLayers.Clear();
             }
-        }
 
-        // Callback for Stage ContextLostSignal
-        private void OnContextLost()
-        {
-            if (_stageContextLostEventHandler != null)
-            {
-                _stageContextLostEventHandler(this, null);
-            }
-        }
+            this.DisconnectNativeSignals();
 
-        // Callback for Stage ContextRegainedSignal
-        private void OnContextRegained()
-        {
-            if (_stageContextRegainedEventHandler != null)
-            {
-                _stageContextRegainedEventHandler(this, null);
-            }
+            base.Dispose(type);
         }
 
-        // Callback for Stage SceneCreatedSignal
-        private void OnSceneCreated()
+        /// This will not be public opened.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
         {
-            if (_stageSceneCreatedEventHandler != null)
-            {
-                _stageSceneCreatedEventHandler(this, null);
-            }
+            Interop.Window.DeleteWindow(swigCPtr);
         }
 
-        private void OnResized(IntPtr windowSize)
-        {
-            ResizedEventArgs e = new ResizedEventArgs();
-            var val = new Uint16Pair(windowSize, false);
-            e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
-            val.Dispose();
-
-            if (_windowResizedEventHandler != null)
-            {
-                _windowResizedEventHandler(this, e);
-            }
-        }
+        private static Dictionary<int, internalHookCallbackType> frameCallbackList = new Dictionary<int, internalHookCallbackType>();
 
-        private void OnWindowFocusedChanged2(bool focusGained)
-        {
-            FocusChangedEventArgs e = new FocusChangedEventArgs();
+        private static readonly object locker = new object();
 
-            e.FocusGained = focusGained;
+        private static int key = 0;
 
-            if (_windowFocusChangedEventHandler2 != null)
-            {
-                _windowFocusChangedEventHandler2(this, e);
-            }
-        }
+        private static FrameCallbackType internalHookFrameCallback = OnInternalHookFrameCallback;
 
-        /// <summary>
-        /// The focus changed event argument.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public class FocusChangedEventArgs : EventArgs
+        private struct internalHookCallbackType
         {
-            /// <summary>
-            /// FocusGained flag.
-            /// </summary>
-            /// <since_tizen> 3 </since_tizen>
-            public bool FocusGained
-            {
-                get;
-                set;
-            }
+            public FrameCallbackType userCallback;
+            public int frameId;
         }
 
-        /// <summary>
-        /// The touch event argument.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public class TouchEventArgs : EventArgs
+        private static void OnInternalHookFrameCallback(int id)
         {
-            private Touch _touch;
-
-            /// <summary>
-            /// Touch.
-            /// </summary>
-            /// <since_tizen> 3 </since_tizen>
-            public Touch Touch
+            lock (locker)
             {
-                get
-                {
-                    return _touch;
-                }
-                set
+                if (frameCallbackList.ContainsKey(id))
                 {
-                    _touch = value;
+                    if (frameCallbackList[id].userCallback != null)
+                    {
+                        frameCallbackList[id].userCallback.Invoke(frameCallbackList[id].frameId);
+                        frameCallbackList.Remove(id);
+                    }
+                    else
+                    {
+                        NUILog.Error($"found userCallback is NULL");
+                        frameCallbackList.Remove(id);
+                    }
                 }
             }
         }
 
-        /// <summary>
-        /// Wheel event arguments.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public class WheelEventArgs : EventArgs
+        private int AddInterHookCallback(FrameCallbackType callback, int frameId)
         {
-            private Wheel _wheel;
-
-            /// <summary>
-            /// Wheel.
-            /// </summary>
-            /// <since_tizen> 3 </since_tizen>
-            public Wheel Wheel
+            if (null == callback)
             {
-                get
-                {
-                    return _wheel;
-                }
-                set
-                {
-                    _wheel = value;
-                }
+                throw new ArgumentNullException(nameof(callback), "FrameCallbackType should not be null");
             }
-        }
-
-        /// <summary>
-        /// Key event arguments.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public class KeyEventArgs : EventArgs
-        {
-            private Key _key;
-
-            /// <summary>
-            /// Key.
-            /// </summary>
-            /// <since_tizen> 3 </since_tizen>
-            public Key Key
+            var assignedKey = 0;
+            lock (locker)
             {
-                get
-                {
-                    return _key;
-                }
-                set
+                key++;
+                assignedKey = key;
+                frameCallbackList.Add(assignedKey, new internalHookCallbackType()
                 {
-                    _key = value;
-                }
+                    userCallback = callback,
+                    frameId = frameId,
+                });
             }
+            return assignedKey;
         }
 
         /// <summary>
-        /// Sets position and size of the window. This API guarantees that
-        /// both moving and resizing of window will appear on the screen at once.
+        /// Type of callback which is called when the frame rendering is done by graphics driver or when the frame is displayed on display.
         /// </summary>
+        /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Rectangle WindowPositionSize
-        {
-            get
-            {
-                Position2D position = GetPosition();
-                Size2D size = GetSize();
-                Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
-                return ret;
-            }
-            set
-            {
-                SetPositionSize(value);
-            }
-        }
-
-        /// <summary>
-        /// Feeds a key event into the window.
-        /// This resized event arguments.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        public class ResizedEventArgs : EventArgs
-        {
-            Size2D _windowSize;
-
-            /// <summary>
-            /// This window size.
-            /// </summary>
-            /// <since_tizen> 4 </since_tizen>
-            public Size2D WindowSize
-            {
-                get
-                {
-                    return _windowSize;
-                }
-                set
-                {
-                    _windowSize = value;
-                }
-            }
-        }
+        public delegate void FrameCallbackType(int frameId);
 
         /// <summary>
-        /// Please do not use! this will be deprecated
+        /// Adds a callback that is called when the frame rendering is done by the graphics driver.
+        /// A callback of the following type may be used:
+        /// <code>
+        /// void MyFunction( int frameId )
+        /// </code>
+        /// This callback will be deleted once it is called.
+        /// <remarks>
+        /// Ownership of the callback is passed onto this class
+        /// </remarks>
         /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " +
-            "Like: " +
-            "Window.Instance.FocusChanged = OnFocusChanged; " +
-            "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
+        /// <param name="callback">The function to call</param>
+        /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
+        /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public class WindowFocusChangedEventArgs : EventArgs
+        public void AddFrameRenderedCallback(FrameCallbackType callback, int frameId)
         {
-            /// <summary>
-            /// Please do not use! this will be deprecated
-            /// </summary>
-            /// <since_tizen> 3 </since_tizen>
-            public bool FocusGained
-            {
-                get;
-                set;
-            }
-        }
+            var assignedKey = AddInterHookCallback(callback, frameId);
+            Interop.WindowInternal.AddFrameRenderedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
 
-        /// <summary>
-        /// Contains and encapsulates Native Window handle.
-        /// </summary>
-        /// <since_tizen> 4 </since_tizen>
-        public class SafeNativeWindowHandle : SafeHandle
-        {
-            /// <summary>
-            /// Contructor, Native window handle is set to handle.
-            /// </summary>
-            /// <since_tizen> 4 </since_tizen>
-            public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
-            {
-                SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
-            }
-            /// <summary>
-            /// Null check if the handle is valid or not.
-            /// </summary>
-            /// <since_tizen> 4 </since_tizen>
-            public override bool IsInvalid
-            {
-                get
-                {
-                    return this.handle == IntPtr.Zero;
-                }
-            }
-            /// <summary>
-            /// Release handle itself.
-            /// </summary>
-            /// <returns>true when released successfully.</returns>
-            /// <since_tizen> 4 </since_tizen>
-            protected override bool ReleaseHandle()
-            {
-                return true;
-            }
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
         /// <summary>
-        /// Disconnect all native signals
+        /// Adds a callback that is called when the frame is displayed on the display.
+        /// A callback of the following type may be used:
+        /// <code>
+        /// void MyFunction( int frameId )
+        /// </code>
+        /// This callback will be deleted once it is called.
+        /// <remarks>
+        /// Ownership of the callback is passed onto this class
+        /// </remarks>
         /// </summary>
-        /// <since_tizen> 5 </since_tizen>
-        internal void DisconnectNativeSignals()
+        /// <param name="callback">The function to call</param>
+        /// <param name="frameId">The Id to specify the frame. It will be passed when the callback is called.</param>
+        /// <exception cref="ArgumentNullException">This exception can occur by the callback is null.</exception>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void AddFramePresentedCallback(FrameCallbackType callback, int frameId)
         {
-            if( _windowFocusChangedEventCallback != null )
-            {
-                WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
-            }
-
-            if( _rootLayerTouchDataCallback != null )
-            {
-                TouchDataSignal().Disconnect(_rootLayerTouchDataCallback);
-            }
-
-            if( _wheelEventCallback != null )
-            {
-                StageWheelEventSignal().Disconnect(_wheelEventCallback);
-            }
-
-            if( _stageKeyCallbackDelegate != null )
-            {
-                KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
-            }
-
-            if( _stageEventProcessingFinishedEventCallbackDelegate != null )
-            {
-                EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
-            }
-
-            if( _stageContextLostEventCallbackDelegate != null )
-            {
-                ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
-            }
-
-            if( _stageContextRegainedEventCallbackDelegate != null )
-            {
-                ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
-            }
-
-            if( _stageSceneCreatedEventCallbackDelegate != null )
-            {
-                SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
-            }
-
-            if( _windowResizedEventCallback != null )
-            {
-                ResizedSignal().Disconnect(_windowResizedEventCallback);
-            }
-
-            if( _windowFocusChangedEventCallback2 != null )
-            {
-                WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
-            }
+            var assignedKey = AddInterHookCallback(callback, frameId);
+            Interop.WindowInternal.AddFramePresentedCallback(SwigCPtr, new HandleRef(this, Marshal.GetFunctionPointerForDelegate<Delegate>(internalHookFrameCallback)), assignedKey);
 
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
-
     }
 }