Merge "[Nsd] Fix feature name" preview1-00181
authorchleun.moon <chleun.moon@samsung.com>
Mon, 11 Sep 2017 05:35:42 +0000 (05:35 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 11 Sep 2017 05:35:43 +0000 (05:35 +0000)
48 files changed:
src/Tizen.NUI/src/internal/AppSignalType.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/Application.cs
src/Tizen.NUI/src/internal/FriendAssembly.cs
src/Tizen.NUI/src/internal/ManualPINVOKE.cs
src/Tizen.NUI/src/internal/NDalicPINVOKE.cs
src/Tizen.NUI/src/internal/NUICoreBackend.cs
src/Tizen.NUI/src/internal/NUIWidgetCoreBackend.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/SWIGTYPE_p_bundle.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface.cs [moved from src/Tizen.NUI/src/internal/SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool.cs with 100% similarity]
src/Tizen.NUI/src/internal/TouchPoint.cs
src/Tizen.NUI/src/internal/ViewWrapperImpl.cs
src/Tizen.NUI/src/internal/WidgetApplication.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/WidgetInstanceCreateSignalType.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/WidgetInstancePauseOrResumeSignalType.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/WidgetInstanceResizeSignalType.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/WidgetInstanceTerminateSignalType.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/WidgetInstanceUpdateSignalType.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/dotnetcore/AddedException.cs
src/Tizen.NUI/src/public/Animation.cs
src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/VideoView.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/VisualView.cs
src/Tizen.NUI/src/public/BaseHandle.cs
src/Tizen.NUI/src/public/Container.cs [new file with mode: 0755]
src/Tizen.NUI/src/public/FocusManager.cs
src/Tizen.NUI/src/public/ImfManager.cs
src/Tizen.NUI/src/public/Layer.cs
src/Tizen.NUI/src/public/NUIApplication.cs
src/Tizen.NUI/src/public/NUIWidgetApplication.cs [new file with mode: 0755]
src/Tizen.NUI/src/public/StyleManager.cs
src/Tizen.NUI/src/public/TTSPlayer.cs
src/Tizen.NUI/src/public/Timer.cs
src/Tizen.NUI/src/public/UIComponents/Button.cs
src/Tizen.NUI/src/public/UIComponents/Popup.cs
src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs
src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs
src/Tizen.NUI/src/public/UIComponents/ScrollView.cs
src/Tizen.NUI/src/public/UIComponents/Slider.cs
src/Tizen.NUI/src/public/VisualMaps.cs
src/Tizen.NUI/src/public/Widget.cs [new file with mode: 0755]
src/Tizen.NUI/src/public/WidgetData.cs [new file with mode: 0755]
src/Tizen.NUI/src/public/Window.cs
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.sln [changed mode: 0755->0644]
src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsDatabase.cs

diff --git a/src/Tizen.NUI/src/internal/AppSignalType.cs b/src/Tizen.NUI/src/internal/AppSignalType.cs
new file mode 100755 (executable)
index 0000000..2ff2a0a
--- /dev/null
@@ -0,0 +1,141 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+namespace Tizen.NUI
+{
+
+    internal class AppSignalType : global::System.IDisposable
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        protected bool swigCMemOwn;
+
+        internal AppSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
+        {
+            swigCMemOwn = cMemoryOwn;
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AppSignalType obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        //A Flag to check who called Dispose(). (By User or DisposeQueue)
+        private bool isDisposeQueued = false;
+        //A Flat to check if it is already disposed.
+        protected bool disposed = false;
+
+        ~AppSignalType()
+        {
+            if (!isDisposeQueued)
+            {
+                isDisposeQueued = true;
+                DisposeQueue.Instance.Add(this);
+            }
+        }
+
+        public void Dispose()
+        {
+            //Throw excpetion if Dispose() is called in separate thread.
+            if (!Window.IsInstalled())
+            {
+                throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+            }
+
+            if (isDisposeQueued)
+            {
+                Dispose(DisposeTypes.Implicit);
+            }
+            else
+            {
+                Dispose(DisposeTypes.Explicit);
+                System.GC.SuppressFinalize(this);
+            }
+        }
+
+        protected virtual void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+
+            }
+
+            //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 (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                swigCMemOwn = false;
+                NDalicManualPINVOKE.delete_AppSignalType(swigCPtr);
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            disposed = true;
+        }
+
+        public bool Empty()
+        {
+            bool ret = NDalicManualPINVOKE.AppSignalType_Empty(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public uint GetConnectionCount()
+        {
+            uint ret = NDalicManualPINVOKE.AppSignalType_GetConnectionCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void Connect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.AppSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Disconnect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.AppSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Emit(WidgetApplication arg)
+        {
+            NDalicManualPINVOKE.AppSignalType_Emit(swigCPtr, WidgetApplication.getCPtr(arg));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public AppSignalType() : this(NDalicManualPINVOKE.new_AppSignalType(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+    }
+}
index 91b60e4..ac6d54d 100755 (executable)
@@ -334,6 +334,61 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_applicationInitEventCallbackDelegate != null)
+            {
+                this.InitSignal().Disconnect(_applicationInitEventCallbackDelegate);
+            }
+
+            if (_applicationTerminateEventCallbackDelegate != null)
+            {
+                this.TerminateSignal().Disconnect(_applicationTerminateEventCallbackDelegate);
+            }
+
+            if (_applicationPauseEventCallbackDelegate != null)
+            {
+                this.PauseSignal().Disconnect(_applicationPauseEventCallbackDelegate);
+            }
+
+            if (_applicationResumeEventCallbackDelegate != null)
+            {
+                this.ResumeSignal().Disconnect(_applicationResumeEventCallbackDelegate);
+            }
+
+            if (_applicationResetEventCallbackDelegate != null)
+            {
+                this.ResetSignal().Disconnect(_applicationResetEventCallbackDelegate);
+            }
+
+            if (_applicationResizeEventCallbackDelegate != null)
+            {
+                this.ResizeSignal().Disconnect(_applicationResizeEventCallbackDelegate);
+            }
+
+            if (_applicationLanguageChangedEventCallbackDelegate != null)
+            {
+                this.LanguageChangedSignal().Disconnect(_applicationLanguageChangedEventCallbackDelegate);
+            }
+
+            if (_applicationRegionChangedEventCallbackDelegate != null)
+            {
+                this.RegionChangedSignal().Disconnect(_applicationRegionChangedEventCallbackDelegate);
+            }
+
+            if (_applicationBatteryLowEventCallbackDelegate != null)
+            {
+                this.BatteryLowSignal().Disconnect(_applicationBatteryLowEventCallbackDelegate);
+            }
+
+            if (_applicationMemoryLowEventCallbackDelegate != null)
+            {
+                this.MemoryLowSignal().Disconnect(_applicationMemoryLowEventCallbackDelegate);
+            }
+
+            if (_applicationAppControlEventCallbackDelegate != null)
+            {
+                this.AppControlSignal().Disconnect(_applicationAppControlEventCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
@@ -1079,8 +1134,27 @@ namespace Tizen.NUI
             return ret;
         }
 
-        //Removed from v0.2.33
-        /*public bool AddIdle(System.Delegate func)
+
+        public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
+        {
+            NUILog.Debug(" NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode) is called! ");
+
+            Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+            // we've got an application now connect the signals
+            ret.SetupDelegates();
+            // set the singleton
+            _instance = ret;
+            return _instance;
+        }
+
+        /// <summary>
+        /// Ensures that the function passed in is called from the main loop when it is idle.
+        /// </summary>
+        /// <param name="func">The function to call</param>
+        /// <returns>true if added successfully, false otherwise</returns>
+        public bool AddIdle(System.Delegate func)
         {
             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
             System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
@@ -1089,9 +1163,7 @@ namespace Tizen.NUI
 
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
-        }*/
-
-
+        }
 
         /**
         * Outer::outer_method(int)
@@ -1132,6 +1204,17 @@ namespace Tizen.NUI
             return ret;
         }
 
+        public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode)
+        {
+            NUILog.Debug("New(string[] args) is called!");
+            int argc = args.Length;
+            string argvStr = string.Join(" ", args);
+
+            Application ret = new Application(NDalicPINVOKE.Application_New__MANUAL_4(argc, argvStr, stylesheet, (int)windowMode), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize)
         {
             Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_4(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true);
index 585ec28..6ba2744 100755 (executable)
@@ -21,7 +21,7 @@
 
 using System.Runtime.CompilerServices;
 [assembly: InternalsVisibleTo("Tizen.NUI.Extension.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001004d7c7c03a196ecb8e7cc5056750e1f40ee2bbe99f0e53a07f2538f2b0f450bd731b9dca3706503a0378baca74a09cf3af6261b330c031f44817ab6ed64189460765a402279d3e0c1fa7295ae1dccb2e3ff329705fd85b58d66ae7cb7e95ba06e0d847c3e3ba918798f579e5caeb1c6149955e6baf24236eec46227a623e494b1")]
-[assembly: InternalsVisibleTo("Tizen.Multimedia, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b1004248416b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693bddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")]
+[assembly: InternalsVisibleTo("Tizen.Multimedia, PublicKey=0024000004800000940000000602000000240000525341310004000001000100bd36a93b6d224759632d08a501b9dcb99a533e8ff0c3a1fc7044f5b05e176c005e5a7fc4d1dfa54da4d4cad4868c4518aa1f661380fb90685dc699d5e48dcc697b33c1e38b70845f405612d6827e7337c191ddd0a0aa35fdad654efe4c54881fdaa82ce35dce18ea918953e448c7aa284a47ed6fe3aa9404930b2b973a28cddf")]
 [assembly: InternalsVisibleTo("Tizen.TV.NUI, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad")]
 
 namespace Tizen.NUI
index ba61c57..e6870e6 100755 (executable)
@@ -795,6 +795,12 @@ namespace Tizen.NUI
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Window_GetPosition")]
         public static extern global::System.IntPtr GetPosition(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_FeedKeyEvent")]
+        public static extern void Window_FeedKeyEvent(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_MakeCallback")]
+        public static extern global::System.IntPtr MakeCallback(global::System.Runtime.InteropServices.HandleRef jarg1);
+
         //for widget view
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_WIDGET_ID_get")]
         public static extern int WidgetView_Property_WIDGET_ID_get();
@@ -926,6 +932,7 @@ namespace Tizen.NUI
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewManager_SWIGUpcast")]
         public static extern global::System.IntPtr WidgetViewManager_SWIGUpcast(global::System.IntPtr jarg1);
 
+
         //For Adaptor
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_New__SWIG_0")]
         public static extern global::System.IntPtr Adaptor_New__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1);
@@ -1039,5 +1046,254 @@ namespace Tizen.NUI
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_AdaptorSignalType")]
         public static extern void delete_AdaptorSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+        //For widget
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_New")]
+        public static extern global::System.IntPtr Widget_New(string jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_Widget__SWIG_0")]
+        public static extern global::System.IntPtr new_Widget__SWIG_0();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_Widget__SWIG_1")]
+        public static extern global::System.IntPtr new_Widget__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_Assign")]
+        public static extern global::System.IntPtr Widget_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_Widget")]
+        public static extern void delete_Widget(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_CreateSignal")]
+        public static extern global::System.IntPtr Widget_CreateSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_TerminateSignal")]
+        public static extern global::System.IntPtr Widget_TerminateSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_PauseSignal")]
+        public static extern global::System.IntPtr Widget_PauseSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_ResumeSignal")]
+        public static extern global::System.IntPtr Widget_ResumeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_ResizeSignal")]
+        public static extern global::System.IntPtr Widget_ResizeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_UpdateSignal")]
+        public static extern global::System.IntPtr Widget_UpdateSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_New")]
+        public static extern global::System.IntPtr WidgetApplication_New(int jarg1, string jarg2, string jarg3);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetApplication__SWIG_0")]
+        public static extern global::System.IntPtr new_WidgetApplication__SWIG_0();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetApplication__SWIG_1")]
+        public static extern global::System.IntPtr new_WidgetApplication__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_Assign")]
+        public static extern global::System.IntPtr WidgetApplication_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetApplication")]
+        public static extern void delete_WidgetApplication(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_MainLoop")]
+        public static extern void WidgetApplication_MainLoop(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_Quit")]
+        public static extern void WidgetApplication_Quit(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_GetWindow")]
+        public static extern global::System.IntPtr WidgetApplication_GetWindow(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_GetResourcePath")]
+        public static extern string WidgetApplication_GetResourcePath();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_InitSignal")]
+        public static extern global::System.IntPtr WidgetApplication_InitSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_TerminateSignal")]
+        public static extern global::System.IntPtr WidgetApplication_TerminateSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_LanguageChangedSignal")]
+        public static extern global::System.IntPtr WidgetApplication_LanguageChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_RegionChangedSignal")]
+        public static extern global::System.IntPtr WidgetApplication_RegionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_BatteryLowSignal")]
+        public static extern global::System.IntPtr WidgetApplication_BatteryLowSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_MemoryLowSignal")]
+        public static extern global::System.IntPtr WidgetApplication_MemoryLowSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_New")]
+        public static extern global::System.IntPtr WidgetData_New(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, string jarg3);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetData__SWIG_0")]
+        public static extern global::System.IntPtr new_WidgetData__SWIG_0();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetData__SWIG_1")]
+        public static extern global::System.IntPtr new_WidgetData__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_Assign")]
+        public static extern global::System.IntPtr WidgetData_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetData")]
+        public static extern void delete_WidgetData(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_GetInstanceId")]
+        public static extern string WidgetData_GetInstanceId(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_GetArgs")]
+        public static extern global::System.IntPtr WidgetData_GetArgs(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_GetContent")]
+        public static extern string WidgetData_GetContent(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_GetWindow")]
+        public static extern global::System.IntPtr WidgetData_GetWindow(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_SetArgs")]
+        public static extern void WidgetData_SetArgs(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_SetContent")]
+        public static extern void WidgetData_SetContent(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_SetWindow")]
+        public static extern void WidgetData_SetWindow(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_Empty")]
+        public static extern bool WidgetInstanceCreateSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_GetConnectionCount")]
+        public static extern uint WidgetInstanceCreateSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_Connect")]
+        public static extern void WidgetInstanceCreateSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_Disconnect")]
+        public static extern void WidgetInstanceCreateSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_Emit")]
+        public static extern void WidgetInstanceCreateSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstanceCreateSignalType")]
+        public static extern global::System.IntPtr new_WidgetInstanceCreateSignalType();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstanceCreateSignalType")]
+        public static extern void delete_WidgetInstanceCreateSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_Empty")]
+        public static extern bool WidgetInstanceTerminateSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_GetConnectionCount")]
+        public static extern uint WidgetInstanceTerminateSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_Connect")]
+        public static extern void WidgetInstanceTerminateSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_Disconnect")]
+        public static extern void WidgetInstanceTerminateSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_Emit")]
+        public static extern void WidgetInstanceTerminateSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, int jarg4);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstanceTerminateSignalType")]
+        public static extern global::System.IntPtr new_WidgetInstanceTerminateSignalType();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstanceTerminateSignalType")]
+        public static extern void delete_WidgetInstanceTerminateSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_Empty")]
+        public static extern bool WidgetInstancePauseOrResumeSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_GetConnectionCount")]
+        public static extern uint WidgetInstancePauseOrResumeSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_Connect")]
+        public static extern void WidgetInstancePauseOrResumeSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_Disconnect")]
+        public static extern void WidgetInstancePauseOrResumeSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_Emit")]
+        public static extern void WidgetInstancePauseOrResumeSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstancePauseOrResumeSignalType")]
+        public static extern global::System.IntPtr new_WidgetInstancePauseOrResumeSignalType();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstancePauseOrResumeSignalType")]
+        public static extern void delete_WidgetInstancePauseOrResumeSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_Empty")]
+        public static extern bool WidgetInstanceResizeSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_GetConnectionCount")]
+        public static extern uint WidgetInstanceResizeSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_Connect")]
+        public static extern void WidgetInstanceResizeSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_Disconnect")]
+        public static extern void WidgetInstanceResizeSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_Emit")]
+        public static extern void WidgetInstanceResizeSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstanceResizeSignalType")]
+        public static extern global::System.IntPtr new_WidgetInstanceResizeSignalType();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstanceResizeSignalType")]
+        public static extern void delete_WidgetInstanceResizeSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_Empty")]
+        public static extern bool WidgetInstanceUpdateSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_GetConnectionCount")]
+        public static extern uint WidgetInstanceUpdateSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_Connect")]
+        public static extern void WidgetInstanceUpdateSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_Disconnect")]
+        public static extern void WidgetInstanceUpdateSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_Emit")]
+        public static extern void WidgetInstanceUpdateSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, int jarg4);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstanceUpdateSignalType")]
+        public static extern global::System.IntPtr new_WidgetInstanceUpdateSignalType();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstanceUpdateSignalType")]
+        public static extern void delete_WidgetInstanceUpdateSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_Empty")]
+        public static extern bool AppSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_GetConnectionCount")]
+        public static extern uint AppSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_Connect")]
+        public static extern void AppSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_Disconnect")]
+        public static extern void AppSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_Emit")]
+        public static extern void AppSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_AppSignalType")]
+        public static extern global::System.IntPtr new_AppSignalType();
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_AppSignalType")]
+        public static extern void delete_AppSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_SWIGUpcast")]
+        public static extern global::System.IntPtr Widget_SWIGUpcast(global::System.IntPtr jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_SWIGUpcast")]
+        public static extern global::System.IntPtr WidgetApplication_SWIGUpcast(global::System.IntPtr jarg1);
+
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_SWIGUpcast")]
+        public static extern global::System.IntPtr WidgetData_SWIGUpcast(global::System.IntPtr jarg1);
     }
 }
index 1939974..e6c72b6 100755 (executable)
@@ -6296,6 +6296,9 @@ class NDalicPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_New__SWIG_3")]
   public static extern global::System.IntPtr Application_New__SWIG_3(int jarg1, string jarg3, int jarg4);
 
+  [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_New__MANUAL_4")]
+  public static extern global::System.IntPtr Application_New__MANUAL_4(int jarg1, string jarg2, string jarg3, int jarg4);
+
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_Application__SWIG_0")]
   public static extern global::System.IntPtr new_Application__SWIG_0();
 
@@ -6428,7 +6431,6 @@ class NDalicPINVOKE {
   [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_Application_New__SWIG_4")]
   public static extern global::System.IntPtr Application_New__SWIG_4(int jarg1, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5);
 
-
   [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TimerSignalType_Empty")]
   public static extern bool TimerSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index 05744b8..3f28755 100755 (executable)
@@ -30,6 +30,8 @@ namespace Tizen.NUI
         /// Application instance to connect event.
         /// </summary>
         protected Application _application;
+        private string _stylesheet = "";
+        private NUIApplication.WindowMode _windowMode = NUIApplication.WindowMode.Opaque;
 
         /// <summary>
         /// Dictionary to contain each type of event callback.
@@ -41,7 +43,6 @@ namespace Tizen.NUI
         /// </summary>
         public NUICoreBackend()
         {
-            _application = Application.NewApplication();
         }
 
         /// <summary>
@@ -49,7 +50,7 @@ namespace Tizen.NUI
         /// </summary>
         public NUICoreBackend(string stylesheet)
         {
-            _application = Application.NewApplication(stylesheet);
+            _stylesheet = stylesheet;
         }
 
         /// <summary>
@@ -57,7 +58,8 @@ namespace Tizen.NUI
         /// </summary>
         public NUICoreBackend(string stylesheet, NUIApplication.WindowMode windowMode)
         {
-            _application = Application.NewApplication(stylesheet, (Application.WindowMode)windowMode );
+            _stylesheet = stylesheet;
+            _windowMode = windowMode;
         }
 
         /// <summary>
@@ -89,7 +91,10 @@ namespace Tizen.NUI
         /// </summary>
         public void Dispose()
         {
-            _application.Dispose();
+            if(_application != null)
+            {
+                _application.Dispose();
+            }
         }
 
         /// <summary>
@@ -97,7 +102,20 @@ namespace Tizen.NUI
         /// </summary>
         public void Exit()
         {
-            _application.Quit();
+            if(_application != null)
+            {
+                _application.Quit();
+            }
+        }
+
+        /// <summary>
+        /// Ensures that the function passed in is called from the main loop when it is idle.
+        /// </summary>
+        /// <param name="func">The function to call</param>
+        /// <returns>true if added successfully, false otherwise</returns>
+        public bool AddIdle(System.Delegate func)
+        {
+            return _application.AddIdle(func);
         }
 
         /// <summary>
@@ -107,6 +125,17 @@ namespace Tizen.NUI
         public void Run(string[] args)
         {
             TizenSynchronizationContext.Initialize();
+
+            args[0] = Tizen.Applications.Application.Current.ApplicationInfo.ExecutablePath;
+            if (args.Length == 1)
+            {
+                _application = Application.NewApplication();
+            }
+            else if (args.Length > 1)
+            {
+                _application = Application.NewApplication(args, _stylesheet, (Application.WindowMode)_windowMode);
+            }
+
             _application.BatteryLow += OnBatteryLow;
             _application.LanguageChanged += OnLanguageChanged;
             _application.MemoryLow += OnMemoryLow;
@@ -221,10 +250,9 @@ namespace Tizen.NUI
         private void OnAppControl(object source, NUIApplicationAppControlEventArgs e)
         {
             Log.Debug("NUI", "NUICorebackend OnAppControl Called");
-            /* can invoke after making new api which getting control handle at application.
             var handler = Handlers[EventType.AppControlReceived] as Action<AppControlReceivedEventArgs>;
-            handler?.Invoke();
-            */
+            SafeAppControlHandle handle = new SafeAppControlHandle(e.VoidP,false);
+            handler?.Invoke( new AppControlReceivedEventArgs(new ReceivedAppControl(handle)) );
         }
 
         /// <summary>
diff --git a/src/Tizen.NUI/src/internal/NUIWidgetCoreBackend.cs b/src/Tizen.NUI/src/internal/NUIWidgetCoreBackend.cs
new file mode 100755 (executable)
index 0000000..ec05e43
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2017 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+
+using Tizen.Applications.CoreBackend;
+using Tizen.Applications;
+
+namespace Tizen.NUI
+{
+    class NUIWidgetCoreBackend : ICoreBackend
+    {
+        /// <summary>
+        /// Application instance to connect event.
+        /// </summary>
+        protected WidgetApplication _application;
+        private string _stylesheet = "";
+
+        /// <summary>
+        /// Dictionary to contain each type of event callback.
+        /// </summary>
+        protected IDictionary<EventType, object> Handlers = new Dictionary<EventType, object>();
+
+        /// <summary>
+        /// The default Constructor.
+        /// </summary>
+        public NUIWidgetCoreBackend()
+        {
+            //Tizen.Log.Fatal("NUI", "### NUIWidgetCoreBackend called");
+            //_application = WidgetApplication.NewWidgetApplication();
+        }
+
+        /// <summary>
+        /// The constructor with stylesheet.
+        /// </summary>
+        public NUIWidgetCoreBackend(string stylesheet)
+        {
+            _stylesheet = stylesheet;
+            //_application = WidgetApplication.NewWidgetApplication(stylesheet);
+        }
+
+        /// <summary>
+        /// Add NUIWidgetApplication event to Application.
+        /// Put each type of event callback in Dictionary.
+        /// </summary>
+        /// <param name="evType">Type of event</param>
+        /// <param name="handler">Event callback</param>
+        public void AddEventHandler(EventType evType, Action handler)
+        {
+            Handlers.Add(evType, handler);
+        }
+
+        /// <summary>
+        /// Add NUIWidgetApplication event to Application.
+        /// Put each type of event callback in Dictionary.
+        /// </summary>
+        /// <typeparam name="TEventArgs">Argument type for the event</typeparam>
+        /// <param name="evType">Type of event</param>
+        /// <param name="handler">Event callback</param>
+        public void AddEventHandler<TEventArgs>(EventType evType, Action<TEventArgs> handler) where TEventArgs : EventArgs
+        {
+            Handlers.Add(evType, handler);
+        }
+
+
+        /// <summary>
+        /// Dispose function.
+        /// </summary>
+        public void Dispose()
+        {
+            Tizen.Log.Fatal("NUI", "### NUIWidgetCoreBackend Dispose called");
+            if (_application != null)
+            {
+                _application.Dispose();
+            }
+        }
+
+        /// <summary>
+        /// Exit Application.
+        /// </summary>
+        public void Exit()
+        {
+            Tizen.Log.Fatal("NUI", "### NUIWidgetCoreBackend Exit called");
+            if (_application != null)
+            {
+                _application.Quit();
+            }
+        }
+
+        /// <summary>
+        /// Run Application.
+        /// </summary>
+        /// <param name="args">Arguments from commandline.</param>
+        public void Run(string[] args)
+        {
+            args[0] = Tizen.Applications.Application.Current.ApplicationInfo.ExecutablePath;
+            _application = WidgetApplication.NewWidgetApplication(args, _stylesheet);
+
+            TizenSynchronizationContext.Initialize();
+            _application.BatteryLow += OnBatteryLow;
+            _application.LanguageChanged += OnLanguageChanged;
+            _application.MemoryLow += OnMemoryLow;
+            _application.RegionChanged += OnRegionChanged; ;
+
+            _application.Init += OnInit;
+            _application.Terminate += OnTerminate;
+
+            _application.MainLoop();
+        }
+
+        private void OnInit(object sender, WidgetApplication.WidgetApplicationEventArgs e)
+        {
+            Log.Fatal("NUI", "NUIWidgetApplication OnPreCreated Called");
+            var preCreateHandler = Handlers[EventType.PreCreated] as Action;
+            preCreateHandler?.Invoke();
+
+            Log.Fatal("NUI", "NUIWidgetApplication OnCreate Called");
+            var createHandler = Handlers[EventType.Created] as Action;
+            createHandler?.Invoke();
+
+        }
+
+        private void OnTerminate(object sender, WidgetApplication.WidgetApplicationEventArgs e)
+        {
+            Log.Fatal("NUI", "NUIWidgetApplication OnTerminated Called");
+            var handler = Handlers[EventType.Terminated] as Action;
+            handler?.Invoke();
+        }
+
+        /// <summary>
+        /// Region changed event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for RegionChanged</param>
+        private void OnRegionChanged(object sender, WidgetApplication.WidgetApplicationEventArgs e)
+        {
+            Log.Fatal("NUI", "NUIWidgetApplication OnRegionChanged Called");
+            var handler = Handlers[EventType.RegionFormatChanged] as Action<RegionFormatChangedEventArgs>;
+            // Need to make new signal return in native to return right value.
+            handler?.Invoke(new RegionFormatChangedEventArgs(""));
+        }
+
+        /// <summary>
+        /// Memory Low event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for MemoryLow</param>
+        private void OnMemoryLow(object sender, WidgetApplication.WidgetApplicationEventArgs e)
+        {
+            Log.Fatal("NUI", "NUIWidgetApplication OnMemoryLow Called");
+            var handler = Handlers[EventType.LowMemory] as Action<LowMemoryEventArgs>;
+            // Need to make new signal return in native to return right value.
+            handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.None));
+        }
+
+        /// <summary>
+        /// Language changed event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for LanguageChanged</param>
+        private void OnLanguageChanged(object sender, WidgetApplication.WidgetApplicationEventArgs e)
+        {
+
+            Log.Fatal("NUI", "NUIWidgetApplication OnLanguageChanged Called");
+            var handler = Handlers[EventType.LocaleChanged] as Action<LocaleChangedEventArgs>;
+            // Need to make new signal return in native to return right value.
+            handler?.Invoke(new LocaleChangedEventArgs(""));
+
+        }
+
+        /// <summary>
+        /// Battery low event callback function.
+        /// </summary>
+        /// <param name="source">Application instance</param>
+        /// <param name="e">Event argument for BatteryLow</param>
+        private void OnBatteryLow(object sender, WidgetApplication.WidgetApplicationEventArgs e)
+        {
+            Log.Fatal("NUI", "NUIWidgetApplication OnBatteryLow Called");
+            var handler = Handlers[EventType.LowBattery] as Action<LowBatteryEventArgs>;
+            // Need to make new signal return in native to return right value.
+            handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.None));
+
+        }
+
+        internal WidgetApplication WidgetApplicationHandle
+        {
+            get
+            {
+                return _application;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_bundle.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_bundle.cs
new file mode 100755 (executable)
index 0000000..2c1c4d0
--- /dev/null
@@ -0,0 +1,40 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+namespace Tizen.NUI
+{
+
+    public class SWIGTYPE_p_bundle
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+
+        internal SWIGTYPE_p_bundle(global::System.IntPtr cPtr, bool futureUse)
+        {
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        protected SWIGTYPE_p_bundle()
+        {
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_bundle obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+    }
+
+}
index 956a3c6..e0f21c5 100755 (executable)
@@ -151,7 +151,7 @@ namespace Tizen.NUI
             get
             {
                 global::System.IntPtr cPtr = NDalicPINVOKE.TouchPoint_hitActor_get(swigCPtr);
-                View ret = (cPtr == global::System.IntPtr.Zero) ? null : Registry.GetManagedBaseHandleFromRefObject(cPtr) as View;
+                View ret = (cPtr == global::System.IntPtr.Zero) ? null : Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                 return ret;
             }
index 94e182e..361ce7e 100755 (executable)
@@ -215,7 +215,7 @@ namespace Tizen.NUI
         public VisualBase GetVisual(int index)
         {
             System.IntPtr cPtr = NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index);
-            VisualBase ret = Registry.GetManagedBaseHandleFromRefObject(cPtr) as VisualBase;
+            VisualBase ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as VisualBase;
 
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
diff --git a/src/Tizen.NUI/src/internal/WidgetApplication.cs b/src/Tizen.NUI/src/internal/WidgetApplication.cs
new file mode 100755 (executable)
index 0000000..9d16fd9
--- /dev/null
@@ -0,0 +1,576 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+using System;
+using System.Runtime.InteropServices;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// Widget application
+    /// </summary>
+    internal class WidgetApplication : BaseHandle
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+
+        internal WidgetApplication(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetApplication_SWIGUpcast(cPtr), cMemoryOwn)
+        {
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetApplication obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        /// <summary>
+        /// To make Window instance be disposed.
+        /// </summary>
+        protected override void Dispose(DisposeTypes type)
+        {
+            if(disposed)
+            {
+                return;
+            }
+
+            if(type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+            }
+
+            //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 (_initCallback != null)
+            {
+                this.InitSignal().Disconnect(_initCallback);
+            }
+            if (_terminateCallback != null)
+            {
+                this.TerminateSignal().Disconnect(_terminateCallback);
+            }
+            if (_languageChangedCallback != null)
+            {
+                this.LanguageChangedSignal().Disconnect(_languageChangedCallback);;
+            }
+            if (_regionChangedCallback != null)
+            {
+                this.RegionChangedSignal().Disconnect(_regionChangedCallback);
+            }
+            if (_batteryLowCallback != null)
+            {
+                this.BatteryLowSignal().Disconnect(_batteryLowCallback);
+            }
+            if (_memoryLowCallback != null)
+            {
+                this.MemoryLowSignal().Disconnect(_memoryLowCallback);
+            }
+            
+            if (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                if (swigCMemOwn)
+                {
+                    swigCMemOwn = false;
+                    NDalicManualPINVOKE.delete_WidgetApplication(swigCPtr);
+                }
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            base.Dispose(type);
+        }
+
+        internal static WidgetApplication GetWidgetApplicationFromPtr(global::System.IntPtr cPtr)
+        {
+            WidgetApplication ret = new WidgetApplication(cPtr, false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public static WidgetApplication instance
+        {
+            get
+            {
+                return _instance;
+            }
+        }
+
+        internal void SetupDelegates()
+        {
+            InitDelegateInternal initializeCallback = new InitDelegateInternal(Initialization);
+
+            NUILog.Debug("InitSignal connection count");
+            this.InitSignal().Connect(initializeCallback);
+            NUILog.Debug("InitSignal connection count = " + InitSignal().GetConnectionCount());
+        }
+
+        public static WidgetApplication NewWidgetApplication(string[] args, string stylesheet)
+        {
+            WidgetApplication ret = New(args, stylesheet);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+            // we've got an application now connect the signals
+            ret.SetupDelegates();
+            _instance = ret;
+            return ret;
+        }
+
+        public static WidgetApplication New(string[] args, string stylesheet)
+        {
+            int argc = args.Length;
+            string argvStr = string.Join(" ", args);
+
+            WidgetApplication ret = new WidgetApplication(NDalicManualPINVOKE.WidgetApplication_New(argc, argvStr, stylesheet), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+        internal WidgetApplication(WidgetApplication widgetApplication) : this(NDalicManualPINVOKE.new_WidgetApplication__SWIG_1(WidgetApplication.getCPtr(widgetApplication)), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal WidgetApplication Assign(WidgetApplication widgetApplication)
+        {
+            WidgetApplication ret = new WidgetApplication(NDalicManualPINVOKE.WidgetApplication_Assign(swigCPtr, WidgetApplication.getCPtr(widgetApplication)), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// This starts the application.
+        /// </summary>
+        public void MainLoop()
+        {
+            NDalicManualPINVOKE.WidgetApplication_MainLoop(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+            {
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        /// <summary>
+        /// This quits the application.
+        /// Tizen applications should use Lower to improve re-start performance unless they need to Quit completely.
+        /// </summary>
+        public void Quit()
+        {
+            NDalicManualPINVOKE.WidgetApplication_Quit(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Get window.
+        /// </summary>
+        /// <returns> The window for widget instance.</returns>
+        public Window GetWindow()
+        {
+            Window ret = new Window(NDalicManualPINVOKE.WidgetApplication_GetWindow(swigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Get path application resources are stored at.
+        /// </summary>
+        /// <returns>The full path of the resources</returns>
+        public static string GetResourcePath()
+        {
+            string ret = NDalicManualPINVOKE.WidgetApplication_GetResourcePath();
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Event arguments that passed via widget app event signal.
+        /// </summary>
+        public class WidgetApplicationEventArgs : EventArgs
+        {
+            /// <summary>
+            /// Widget application.
+            /// </summary>
+            public WidgetApplication WidgetApplication
+            {
+                get;
+                set;
+            }
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void InitCallbackType(IntPtr widgetApplication);
+        private InitCallbackType _initCallback;
+        private DaliEventHandler<object,WidgetApplicationEventArgs> _initEventHandler;
+
+        /// <summary>
+        /// Init event.
+        /// </summary>
+        public event DaliEventHandler<object, WidgetApplicationEventArgs> Init
+        {
+            add
+            {
+                if (_initEventHandler == null)
+                {
+                    _initCallback = new InitCallbackType( OnInit);
+                    InitSignal().Connect(_initCallback);
+                }
+
+                _initEventHandler += value;
+            }
+
+            remove
+            {
+                _initEventHandler -= value;
+
+                if (_initEventHandler == null && InitSignal().Empty() == false)
+                {
+                   InitSignal().Disconnect(_initCallback);
+                }
+            }
+        }
+
+        private void OnInit(IntPtr widgetApplication)
+        {
+            WidgetApplicationEventArgs e = new WidgetApplicationEventArgs();
+            if (widgetApplication != null)
+            {
+                e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication);
+            }
+
+            if (_initEventHandler != null)
+            {
+                _initEventHandler(this, e);
+            }
+        }
+
+        internal AppSignalType InitSignal()
+        {
+            AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_InitSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void TerminateCallbackType(IntPtr widgetApplication);
+        private TerminateCallbackType _terminateCallback;
+        private DaliEventHandler<object, WidgetApplicationEventArgs> _terminateEventHandler;
+
+        /// <summary>
+        /// Terminate event.
+        /// </summary>
+        public event DaliEventHandler<object, WidgetApplicationEventArgs> Terminate
+        {
+            add
+            {
+                if (_terminateEventHandler == null)
+                {
+                    _terminateCallback = new TerminateCallbackType( OnTerminate);
+                    TerminateSignal().Connect(_terminateCallback);
+                }
+
+                _terminateEventHandler += value;
+            }
+
+            remove
+            {
+                _terminateEventHandler -= value;
+
+                if (_terminateEventHandler == null && TerminateSignal().Empty() == false)
+                {
+                   TerminateSignal().Disconnect(_terminateCallback);
+                }
+            }
+        }
+
+        private void OnTerminate(IntPtr widgetApplication)
+        {
+            WidgetApplicationEventArgs e = new WidgetApplicationEventArgs();
+
+            if (widgetApplication != null)
+            {
+                e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication);
+            }
+
+            if (_terminateEventHandler != null)
+            {
+                _terminateEventHandler(this, e);
+            }
+        }
+
+        internal AppSignalType TerminateSignal()
+        {
+            AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_TerminateSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void LanguageChangedCallbackType(IntPtr widgetApplication);
+        private LanguageChangedCallbackType _languageChangedCallback;
+        private DaliEventHandler<object, WidgetApplicationEventArgs> _languageChangedEventHandler;
+
+        /// <summary>
+        /// LanguageChanged event.
+        /// </summary>
+        public event DaliEventHandler<object, WidgetApplicationEventArgs> LanguageChanged
+        {
+            add
+            {
+                if (_languageChangedEventHandler == null)
+                {
+                    _languageChangedCallback = new LanguageChangedCallbackType( OnLanguageChanged);
+                    LanguageChangedSignal().Connect(_languageChangedCallback);
+                }
+
+                _languageChangedEventHandler += value;
+            }
+
+            remove
+            {
+                _languageChangedEventHandler -= value;
+
+                if (_languageChangedEventHandler == null && LanguageChangedSignal().Empty() == false)
+                {
+                   LanguageChangedSignal().Disconnect(_languageChangedCallback);
+                }
+            }
+        }
+
+        private void OnLanguageChanged(IntPtr widgetApplication)
+        {
+            WidgetApplicationEventArgs e = new WidgetApplicationEventArgs();
+
+            if (widgetApplication != null)
+            {
+                e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication);
+            }
+
+            if (_languageChangedEventHandler != null)
+            {
+                _languageChangedEventHandler(this, e);
+            }
+        }
+
+        internal AppSignalType LanguageChangedSignal()
+        {
+            AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_LanguageChangedSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void RegionChangedCallbackType(IntPtr widgetApplication);
+        private RegionChangedCallbackType _regionChangedCallback;
+        private DaliEventHandler<object, WidgetApplicationEventArgs> _regionChangedEventHandler;
+
+        /// <summary>
+        /// RegionChanged event.
+        /// </summary>
+        public event DaliEventHandler<object, WidgetApplicationEventArgs> RegionChanged
+        {
+            add
+            {
+                if (_regionChangedEventHandler == null)
+                {
+                    _regionChangedCallback = new RegionChangedCallbackType( OnRegionChanged );
+                    RegionChangedSignal().Connect(_regionChangedCallback);
+                }
+
+                _regionChangedEventHandler += value;
+            }
+
+            remove
+            {
+                _regionChangedEventHandler -= value;
+
+                if (_regionChangedEventHandler == null && RegionChangedSignal().Empty() == false)
+                {
+                   RegionChangedSignal().Disconnect(_regionChangedCallback);
+                }
+            }
+        }
+
+        private void OnRegionChanged(IntPtr widgetApplication)
+        {
+            WidgetApplicationEventArgs e = new WidgetApplicationEventArgs();
+
+            if (widgetApplication != null)
+            {
+                e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication);
+            }
+
+            if (_regionChangedEventHandler != null)
+            {
+                _regionChangedEventHandler(this, e);
+            }
+        }
+
+        internal AppSignalType RegionChangedSignal()
+        {
+            AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_RegionChangedSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void BatteryLowCallbackType(IntPtr widgetApplication);
+        private BatteryLowCallbackType _batteryLowCallback;
+        private DaliEventHandler<object, WidgetApplicationEventArgs> _batteryLowEventHandler;
+
+        /// <summary>
+        /// BatteryLow event.
+        /// </summary>
+        public event DaliEventHandler<object, WidgetApplicationEventArgs> BatteryLow
+        {
+            add
+            {
+                if (_batteryLowEventHandler == null)
+                {
+                    _batteryLowCallback = new BatteryLowCallbackType( OnBatteryLow );
+                    BatteryLowSignal().Connect(_batteryLowCallback);
+                }
+
+                _batteryLowEventHandler += value;
+            }
+
+            remove
+            {
+                _batteryLowEventHandler -= value;
+
+                if (_batteryLowEventHandler == null && BatteryLowSignal().Empty() == false)
+                {
+                   BatteryLowSignal().Disconnect(_batteryLowCallback);
+                }
+            }
+        }
+
+        private void OnBatteryLow(IntPtr widgetApplication)
+        {
+            WidgetApplicationEventArgs e = new WidgetApplicationEventArgs();
+
+            if (widgetApplication != null)
+            {
+                e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication);
+            }
+
+            if (_batteryLowEventHandler != null)
+            {
+                _batteryLowEventHandler(this, e);
+            }
+        }
+
+        internal AppSignalType BatteryLowSignal()
+        {
+            AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_BatteryLowSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void MemoryLowCallbackType(IntPtr widgetApplication);
+        private MemoryLowCallbackType _memoryLowCallback;
+        private DaliEventHandler<object, WidgetApplicationEventArgs> _memoryLowEventHandler;
+
+        /// <summary>
+        /// MemoryLow event.
+        /// </summary>
+        public event DaliEventHandler<object, WidgetApplicationEventArgs> MemoryLow
+        {
+            add
+            {
+                if (_memoryLowEventHandler == null)
+                {
+                    _memoryLowCallback = new MemoryLowCallbackType (OnMemoryLow);
+                    MemoryLowSignal().Connect(_memoryLowCallback);
+                }
+
+                _memoryLowEventHandler += value;
+            }
+
+            remove
+            {
+                _memoryLowEventHandler -= value;
+
+                if (_memoryLowEventHandler == null && MemoryLowSignal().Empty() == false)
+                {
+                   MemoryLowSignal().Disconnect(_memoryLowCallback);
+                }
+            }
+        }
+
+        private void OnMemoryLow(IntPtr widgetApplication)
+        {
+            WidgetApplicationEventArgs e = new WidgetApplicationEventArgs();
+
+            if (widgetApplication != null)
+            {
+                e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication);
+            }
+
+            if (_memoryLowEventHandler != null)
+            {
+                _memoryLowEventHandler(this, e);
+            }
+        }
+
+        internal AppSignalType MemoryLowSignal()
+        {
+            AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_MemoryLowSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public delegate void InitDelegate();
+
+        public delegate void TerminateDelegate();
+
+        public delegate void LanguageChangedDelegate();
+
+        public delegate void RegionChangedDelegate();
+
+        public delegate void BatteryLowDelegate();
+
+        public delegate void MemoryLowDelegate();
+
+        [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
+        internal delegate void InitDelegateInternal();
+
+        [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
+        internal delegate void TerminateDelegateInternal();
+
+        [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
+        internal delegate void LanguageChangedDelegateInternal();
+
+        [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
+        internal delegate void RegionChangedDelegateInternal();
+
+        [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
+        internal delegate void BatteryLowDelegateInternal();
+
+        [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)]
+        internal delegate void MemoryLowDelegateInternal();
+
+        static void Initialization()
+        {
+            // instance.InitDelegate();
+        }
+
+        private static WidgetApplication _instance; //singleton
+
+    }
+
+}
diff --git a/src/Tizen.NUI/src/internal/WidgetInstanceCreateSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstanceCreateSignalType.cs
new file mode 100755 (executable)
index 0000000..16543dd
--- /dev/null
@@ -0,0 +1,143 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+namespace Tizen.NUI
+{
+
+    internal class WidgetInstanceCreateSignalType : global::System.IDisposable
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        protected bool swigCMemOwn;
+
+        internal WidgetInstanceCreateSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
+        {
+            swigCMemOwn = cMemoryOwn;
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstanceCreateSignalType obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        //A Flag to check who called Dispose(). (By User or DisposeQueue)
+        private bool isDisposeQueued = false;
+        //A Flat to check if it is already disposed.
+        protected bool disposed = false;
+
+        ~WidgetInstanceCreateSignalType()
+        {
+            if (!isDisposeQueued)
+            {
+                isDisposeQueued = true;
+                DisposeQueue.Instance.Add(this);
+            }
+        }
+
+        public void Dispose()
+        {
+            //Throw excpetion if Dispose() is called in separate thread.
+            if (!Window.IsInstalled())
+            {
+                throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+            }
+
+            if (isDisposeQueued)
+            {
+                Dispose(DisposeTypes.Implicit);
+            }
+            else
+            {
+                Dispose(DisposeTypes.Explicit);
+                System.GC.SuppressFinalize(this);
+            }
+        }
+
+        protected virtual void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+
+            }
+
+            //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 (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                swigCMemOwn = false;
+                NDalicManualPINVOKE.delete_WidgetInstanceCreateSignalType(swigCPtr);
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            disposed = true;
+        }
+
+        public bool Empty()
+        {
+            bool ret = NDalicManualPINVOKE.WidgetInstanceCreateSignalType_Empty(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public uint GetConnectionCount()
+        {
+            uint ret = NDalicManualPINVOKE.WidgetInstanceCreateSignalType_GetConnectionCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void Connect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstanceCreateSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Disconnect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstanceCreateSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Emit(WidgetData arg1, SWIGTYPE_p_bundle arg2, Uint16Pair arg3)
+        {
+            NDalicManualPINVOKE.WidgetInstanceCreateSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg1), SWIGTYPE_p_bundle.getCPtr(arg2), Uint16Pair.getCPtr(arg3));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public WidgetInstanceCreateSignalType() : this(NDalicManualPINVOKE.new_WidgetInstanceCreateSignalType(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+    }
+
+}
diff --git a/src/Tizen.NUI/src/internal/WidgetInstancePauseOrResumeSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstancePauseOrResumeSignalType.cs
new file mode 100755 (executable)
index 0000000..49a170b
--- /dev/null
@@ -0,0 +1,143 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+namespace Tizen.NUI
+{
+
+    internal class WidgetInstancePauseOrResumeSignalType : global::System.IDisposable
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        protected bool swigCMemOwn;
+
+        internal WidgetInstancePauseOrResumeSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
+        {
+            swigCMemOwn = cMemoryOwn;
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstancePauseOrResumeSignalType obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        //A Flag to check who called Dispose(). (By User or DisposeQueue)
+        private bool isDisposeQueued = false;
+        //A Flat to check if it is already disposed.
+        protected bool disposed = false;
+
+        ~WidgetInstancePauseOrResumeSignalType()
+        {
+            if (!isDisposeQueued)
+            {
+                isDisposeQueued = true;
+                DisposeQueue.Instance.Add(this);
+            }
+        }
+
+        public void Dispose()
+        {
+            //Throw excpetion if Dispose() is called in separate thread.
+            if (!Window.IsInstalled())
+            {
+                throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+            }
+
+            if (isDisposeQueued)
+            {
+                Dispose(DisposeTypes.Implicit);
+            }
+            else
+            {
+                Dispose(DisposeTypes.Explicit);
+                System.GC.SuppressFinalize(this);
+            }
+        }
+
+        protected virtual void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+
+            }
+
+            //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 (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                swigCMemOwn = false;
+                NDalicManualPINVOKE.delete_WidgetInstancePauseOrResumeSignalType(swigCPtr);
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            disposed = true;
+        }
+
+        public bool Empty()
+        {
+            bool ret = NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_Empty(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public uint GetConnectionCount()
+        {
+            uint ret = NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_GetConnectionCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void Connect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Disconnect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Emit(WidgetData arg)
+        {
+            NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public WidgetInstancePauseOrResumeSignalType() : this(NDalicManualPINVOKE.new_WidgetInstancePauseOrResumeSignalType(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+    }
+
+}
diff --git a/src/Tizen.NUI/src/internal/WidgetInstanceResizeSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstanceResizeSignalType.cs
new file mode 100755 (executable)
index 0000000..0685f80
--- /dev/null
@@ -0,0 +1,142 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+namespace Tizen.NUI
+{
+
+    internal class WidgetInstanceResizeSignalType : global::System.IDisposable
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        protected bool swigCMemOwn;
+
+        internal WidgetInstanceResizeSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
+        {
+            swigCMemOwn = cMemoryOwn;
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstanceResizeSignalType obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        //A Flag to check who called Dispose(). (By User or DisposeQueue)
+        private bool isDisposeQueued = false;
+        //A Flat to check if it is already disposed.
+        protected bool disposed = false;
+
+        ~WidgetInstanceResizeSignalType()
+        {
+            if (!isDisposeQueued)
+            {
+                isDisposeQueued = true;
+                DisposeQueue.Instance.Add(this);
+            }
+        }
+        public void Dispose()
+        {
+            //Throw excpetion if Dispose() is called in separate thread.
+            if (!Window.IsInstalled())
+            {
+                throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+            }
+
+            if (isDisposeQueued)
+            {
+                Dispose(DisposeTypes.Implicit);
+            }
+            else
+            {
+                Dispose(DisposeTypes.Explicit);
+                System.GC.SuppressFinalize(this);
+            }
+        }
+
+        protected virtual void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+
+            }
+
+            //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 (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                swigCMemOwn = false;
+                NDalicManualPINVOKE.delete_WidgetInstanceResizeSignalType(swigCPtr);
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            disposed = true;
+        }
+
+        public bool Empty()
+        {
+            bool ret = NDalicManualPINVOKE.WidgetInstanceResizeSignalType_Empty(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public uint GetConnectionCount()
+        {
+            uint ret = NDalicManualPINVOKE.WidgetInstanceResizeSignalType_GetConnectionCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void Connect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstanceResizeSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Disconnect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstanceResizeSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Emit(WidgetData arg1, Uint16Pair arg2)
+        {
+            NDalicManualPINVOKE.WidgetInstanceResizeSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg1), Uint16Pair.getCPtr(arg2));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public WidgetInstanceResizeSignalType() : this(NDalicManualPINVOKE.new_WidgetInstanceResizeSignalType(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+    }
+
+}
diff --git a/src/Tizen.NUI/src/internal/WidgetInstanceTerminateSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstanceTerminateSignalType.cs
new file mode 100755 (executable)
index 0000000..1e4327f
--- /dev/null
@@ -0,0 +1,142 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+namespace Tizen.NUI
+{
+
+    internal class WidgetInstanceTerminateSignalType : global::System.IDisposable
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        protected bool swigCMemOwn;
+
+        internal WidgetInstanceTerminateSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
+        {
+            swigCMemOwn = cMemoryOwn;
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstanceTerminateSignalType obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        //A Flag to check who called Dispose(). (By User or DisposeQueue)
+        private bool isDisposeQueued = false;
+        //A Flat to check if it is already disposed.
+        protected bool disposed = false;
+
+        ~WidgetInstanceTerminateSignalType()
+        {
+            if (!isDisposeQueued)
+            {
+                isDisposeQueued = true;
+                DisposeQueue.Instance.Add(this);
+            }
+        }
+
+        public void Dispose()
+        {
+            //Throw excpetion if Dispose() is called in separate thread.
+            if (!Window.IsInstalled())
+            {
+                throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+            }
+
+            if (isDisposeQueued)
+            {
+                Dispose(DisposeTypes.Implicit);
+            }
+            else
+            {
+                Dispose(DisposeTypes.Explicit);
+                System.GC.SuppressFinalize(this);
+            }
+        }
+
+        protected virtual void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+
+            }
+
+            //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 (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                swigCMemOwn = false;
+                NDalicManualPINVOKE.delete_WidgetInstanceTerminateSignalType(swigCPtr);
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            disposed = true;
+        }
+
+        public bool Empty()
+        {
+            bool ret = NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_Empty(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public uint GetConnectionCount()
+        {
+            uint ret = NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_GetConnectionCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void Connect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Disconnect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Emit(WidgetData arg1, SWIGTYPE_p_bundle arg2, Widget.WidgetTerminateType arg3)
+        {
+            NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg1), SWIGTYPE_p_bundle.getCPtr(arg2), (int)arg3);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public WidgetInstanceTerminateSignalType() : this(NDalicManualPINVOKE.new_WidgetInstanceTerminateSignalType(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+    }
+
+}
diff --git a/src/Tizen.NUI/src/internal/WidgetInstanceUpdateSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstanceUpdateSignalType.cs
new file mode 100755 (executable)
index 0000000..26480b5
--- /dev/null
@@ -0,0 +1,143 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+namespace Tizen.NUI
+{
+
+    internal class WidgetInstanceUpdateSignalType : global::System.IDisposable
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+        protected bool swigCMemOwn;
+
+        internal WidgetInstanceUpdateSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)
+        {
+            swigCMemOwn = cMemoryOwn;
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstanceUpdateSignalType obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        //A Flag to check who called Dispose(). (By User or DisposeQueue)
+        private bool isDisposeQueued = false;
+        //A Flat to check if it is already disposed.
+        protected bool disposed = false;
+
+        ~WidgetInstanceUpdateSignalType()
+        {
+            if (!isDisposeQueued)
+            {
+                isDisposeQueued = true;
+                DisposeQueue.Instance.Add(this);
+            }
+        }
+
+        public void Dispose()
+        {
+            //Throw excpetion if Dispose() is called in separate thread.
+            if (!Window.IsInstalled())
+            {
+                throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+            }
+
+            if (isDisposeQueued)
+            {
+                Dispose(DisposeTypes.Implicit);
+            }
+            else
+            {
+                Dispose(DisposeTypes.Explicit);
+                System.GC.SuppressFinalize(this);
+            }
+        }
+
+        protected virtual void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            if (type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+
+            }
+
+            //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 (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                swigCMemOwn = false;
+                NDalicManualPINVOKE.delete_WidgetInstanceUpdateSignalType(swigCPtr);
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            disposed = true;
+        }
+
+        public bool Empty()
+        {
+            bool ret = NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_Empty(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public uint GetConnectionCount()
+        {
+            uint ret = NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_GetConnectionCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        public void Connect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Disconnect(System.Delegate func)
+        {
+            System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+            {
+                NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        public void Emit(WidgetData arg1, SWIGTYPE_p_bundle arg2, int arg3)
+        {
+            NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg1), SWIGTYPE_p_bundle.getCPtr(arg2), arg3);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        public WidgetInstanceUpdateSignalType() : this(NDalicManualPINVOKE.new_WidgetInstanceUpdateSignalType(), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+    }
+
+}
index be7d0dd..01525ed 100755 (executable)
@@ -18,37 +18,37 @@ namespace System
 {
     public class ApplicationException : Exception
     {
-        public ApplicationException()
+        public ApplicationException(): base()
         {
-            new global::System.ApplicationException();
+            //add anything required
         }
 
-        public ApplicationException(string message)
+        public ApplicationException(string message): base(message)
         {
-            new global::System.ApplicationException(message);
+            //add anything required
         }
 
-        public ApplicationException(string message, Exception innerException)
+        public ApplicationException(string message, Exception innerException): base(message, innerException)
         {
-            new global::System.ApplicationException(message, innerException);
+            //add anything required
         }
     }
 
     public class SystemException : Exception
     {
-        public SystemException()
+        public SystemException(): base()
         {
-            new global::System.SystemException();
+            //add anything required
         }
 
-        public SystemException(string message)
+        public SystemException(string message): base(message)
         {
-            new global::System.SystemException(message);
+            //add anything required
         }
 
-        public SystemException(string message, Exception innerException)
+        public SystemException(string message, Exception innerException): base(message, innerException)
         {
-            new global::System.SystemException(message, innerException);
+            //add anything required
         }
     }
 }
index b0deba5..422e0ad 100755 (executable)
@@ -65,6 +65,17 @@ namespace Tizen.NUI
 
             }
 
+            if (_animationFinishedEventCallback != null)
+            {
+                FinishedSignal().Disconnect(_animationFinishedEventCallback);
+            }
+
+            if (_animationProgressReachedEventCallback != null)
+            {
+
+                ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
+            }
+
             if(this)
             {
                 this.Clear();
@@ -73,7 +84,6 @@ namespace Tizen.NUI
                 //throw new System.InvalidOperationException("Animation Instance should not be disposed until getting Finished event. Should be a global variable");
             }
 
-
             //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.
@@ -175,7 +185,7 @@ namespace Tizen.NUI
                 if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false)
                 {
                     NUILog.Debug("[remove before]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
-                    ProgressReachedSignal().Disconnect(_animationProgressReachedEventHandler);
+                    ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback);
                     NUILog.Debug("[remove after]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount());
                 }
             }
@@ -879,6 +889,23 @@ namespace Tizen.NUI
             return ret;
         }
 
+        private static bool? disableAnimation = null;
+        private bool DisableAnimation
+        {
+            get
+            {
+                if (disableAnimation.HasValue == false)
+                {
+                    string type = Environment.GetEnvironmentVariable("PlatformSmartType");
+                    if (type == "Entry")
+                        disableAnimation = true;
+                    else
+                        disableAnimation = false;
+                }
+                return disableAnimation.Value;
+            }
+        }
+
         /// <summary>
         /// Plays the animation.
         /// </summary>
@@ -886,9 +913,9 @@ namespace Tizen.NUI
         {
             NDalicPINVOKE.Animation_Play(swigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-#if DISABLE_ANIMATION
-            Stop(EndActions.StopFinal);
-#endif
+
+            if (DisableAnimation == true)
+                Stop(EndActions.StopFinal);
         }
 
         /// <summary>
@@ -908,10 +935,10 @@ namespace Tizen.NUI
         /// The delay time is not included in the looping time.<br/>
         /// When the delay time is negative value, it would treat as play immediately.<br/>
         /// </summary>
-        /// <param name="delayMiliSeconds">The delay time</param>
-        public void PlayAfter(int delayMiliSeconds)
+        /// <param name="delayMilliseconds">The delay time</param>
+        public void PlayAfter(int delayMilliseconds)
         {
-            NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMiliSeconds));
+            NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
index 37b8cfd..3803986 100755 (executable)
@@ -53,6 +53,8 @@ namespace Tizen.NUI.BaseComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            DisConnectFromSignals();
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
@@ -66,6 +68,34 @@ namespace Tizen.NUI.BaseComponents
             base.Dispose(type);
         }
 
+        private void DisConnectFromSignals()
+        {
+            // Save current CPtr.
+            global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr;
+
+            // Use BaseHandle CPtr as current might have been deleted already in derived classes.
+            swigCPtr = GetBaseHandleCPtrHandleRef;
+
+            if (_scrollableCompletedCallbackDelegate != null)
+            {
+                this.ScrollCompletedSignal().Disconnect(_scrollableCompletedCallbackDelegate);
+            }
+
+            if (_scrollableUpdatedCallbackDelegate != null)
+            {
+                this.ScrollUpdatedSignal().Disconnect(_scrollableUpdatedCallbackDelegate);
+            }
+
+            if (_scrollableStartedCallbackDelegate != null)
+            {
+                this.ScrollStartedSignal().Disconnect(_scrollableStartedCallbackDelegate);
+            }
+
+            // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
+            // Restore current CPtr.
+            swigCPtr = currentCPtr;
+        }
+
         public class StartedEventArgs : EventArgs
         {
             private Vector2 _vector2;
index 5ccab67..11e8199 100755 (executable)
@@ -64,6 +64,11 @@ namespace Tizen.NUI.BaseComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_textEditorTextChangedCallbackDelegate != null)
+            {
+                TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
@@ -1342,9 +1347,9 @@ namespace Tizen.NUI.BaseComponents
                 }
                 switch (temp)
                 {
-                    case "WORD":
+                    case "WRAP_MODE_WORD":
                     return LineWrapMode.Word;
-                    case "CHARACTER":
+                    case "WRAP_MODE_CHARACTER":
                     return LineWrapMode.Character;
                     default:
                     return LineWrapMode.Word;
@@ -1357,12 +1362,12 @@ namespace Tizen.NUI.BaseComponents
                 {
                     case LineWrapMode.Word:
                     {
-                        temp = "WORD";
+                        temp = "WRAP_MODE_WORD";
                         break;
                     }
                     case LineWrapMode.Character:
                     {
-                        temp = "CHARACTER";
+                        temp = "WRAP_MODE_CHARACTER";
                         break;
                     }
                 }
index ba7d45c..09dc7d7 100755 (executable)
@@ -63,6 +63,16 @@ namespace Tizen.NUI.BaseComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_textFieldMaxLengthReachedCallbackDelegate != null)
+            {
+                this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate);
+            }
+
+            if (_textFieldTextChangedCallbackDelegate != null)
+            {
+                TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index 4abad84..83931f8 100755 (executable)
@@ -757,6 +757,25 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
+        /// TextColorAnimatable property.<br>
+        /// The color of the text that can be animatated.<br>
+        /// Animation framework can be used to change the color of the text when not using mark up.<br>
+        /// Not possible when text is auto scrolling. <br>
+        /// </summary>
+        public Color TextColorAnimatable
+        {
+            get
+            {
+                Color animatableColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
+                GetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE).Get(animatableColor);
+                return animatableColor;
+            }
+            set
+            {
+                SetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE, new Tizen.NUI.PropertyValue(value));
+            }
+        }
+
         /// The line count of text.
         /// </summary>
         public int LineCount
@@ -784,9 +803,9 @@ namespace Tizen.NUI.BaseComponents
                 }
                 switch (temp)
                 {
-                    case "WORD":
+                    case "WRAP_MODE_WORD":
                     return LineWrapMode.Word;
-                    case "CHARACTER":
+                    case "WRAP_MODE_CHARACTER":
                     return LineWrapMode.Character;
                     default:
                     return LineWrapMode.Word;
@@ -811,25 +830,5 @@ namespace Tizen.NUI.BaseComponents
                 SetProperty(TextLabel.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp));
             }
         }
-
-        /// TextColorAnimatable property.<br>
-        /// The color of the text that can be animatated.<br>
-        /// Animation framework can be used to change the color of the text when not using mark up.<br>
-        /// Not possible when text is auto scrolling. <br>
-        /// </summary>
-        public Color TextColorAnimatable
-        {
-            get
-            {
-                Color animatableColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
-                GetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE).Get(animatableColor);
-                return animatableColor;
-            }
-            set
-            {
-                SetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE, new Tizen.NUI.PropertyValue(value));
-            }
-        }
-
     }
 }
index 0c8e0de..ae73ef1 100755 (executable)
@@ -55,6 +55,11 @@ namespace Tizen.NUI.BaseComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_videoViewFinishedCallbackDelegate != null)
+            {
+                FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index cedb4d0..d4a2bec 100755 (executable)
@@ -20,12 +20,10 @@ namespace Tizen.NUI.BaseComponents
     using System;
     using System.Runtime.InteropServices;
 
-
-
     /// <summary>
     /// View is the base class for all views.
     /// </summary>
-    public class View : Animatable //CustomActor => Animatable
+    public class View : Container
     {
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
 
@@ -40,6 +38,88 @@ namespace Tizen.NUI.BaseComponents
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
         }
 
+        // From Container Base class
+
+        /// <summary>
+        /// Adds a child view to this View.
+        /// </summary>
+        /// <seealso cref="Container::Add()">
+        /// </seealso>
+        public override void Add(View child)
+        {
+            NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Removes a child View from this View. If the view was not a child of this view, this is a no-op.
+        /// </summary>
+        /// <seealso cref="Container::Remove()">
+        /// </seealso>
+        public override void Remove(View child)
+        {
+            NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Retrieves child view by index.
+        /// </summary>
+        /// <seealso cref="Container::GetChildAt()">
+        /// </seealso>
+        public override View GetChildAt(uint index)
+        {
+            IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index);
+
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret ?? null;
+        }
+
+        /// <summary>
+        /// Retrieves the number of children held by the view.
+        /// </summary>
+        /// <seealso cref="Container::GetChildCount()">
+        /// </seealso>
+        protected override uint GetChildCount()
+        {
+            uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Get the Views parent
+        /// </summary>
+        /// <seealso cref="Container::GetParent()">
+        protected override Container GetParent()
+        {
+            Container ret;
+            IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+
+            BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+
+            if(basehandle is Layer)
+            {
+                ret = basehandle as Layer;
+            }
+            else
+            {
+                ret = basehandle as View;
+            }
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        ///
+
         // you can override it to clean-up your own resources.
         protected override void Dispose(DisposeTypes type)
         {
@@ -59,6 +139,8 @@ namespace Tizen.NUI.BaseComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            DisConnectFromSignals();
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
@@ -72,6 +154,99 @@ namespace Tizen.NUI.BaseComponents
             base.Dispose(type);
         }
 
+        private void DisConnectFromSignals()
+        {
+            // Save current CPtr.
+            global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr;
+
+            // Use BaseHandle CPtr as current might have been deleted already in derived classes.
+            swigCPtr = GetBaseHandleCPtrHandleRef;
+
+            if (_onRelayoutEventCallback != null)
+            {
+                this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
+            }
+
+            if (_offWindowEventCallback != null)
+            {
+                this.OffWindowSignal().Disconnect(_offWindowEventCallback);
+            }
+
+            if (_onWindowEventCallback != null)
+            {
+                this.OnWindowSignal().Disconnect(_onWindowEventCallback);
+            }
+
+            if (_wheelEventCallback != null)
+            {
+                this.WheelEventSignal().Disconnect(_wheelEventCallback);
+            }
+
+            if (_hoverEventCallback != null)
+            {
+                this.HoveredSignal().Disconnect(_hoverEventCallback);
+            }
+
+            if (_touchDataCallback != null)
+            {
+                this.TouchSignal().Disconnect(_touchDataCallback);
+            }
+
+            if (_ResourcesLoadedCallback != null)
+            {
+                this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback);
+            }
+
+            if (_offWindowEventCallback != null)
+            {
+                this.OffWindowSignal().Disconnect(_offWindowEventCallback);
+            }
+
+            if (_onWindowEventCallback != null)
+            {
+                this.OnWindowSignal().Disconnect(_onWindowEventCallback);
+            }
+
+            if (_wheelEventCallback != null)
+            {
+                this.WheelEventSignal().Disconnect(_wheelEventCallback);
+            }
+
+            if (_hoverEventCallback != null)
+            {
+                this.HoveredSignal().Disconnect(_hoverEventCallback);
+            }
+
+            if (_touchDataCallback != null)
+            {
+                this.TouchSignal().Disconnect(_touchDataCallback);
+            }
+
+            if (_onRelayoutEventCallback != null)
+            {
+                this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
+            }
+
+            if (_keyCallback != null)
+            {
+                this.KeyEventSignal().Disconnect(_keyCallback);
+            }
+
+            if (_keyInputFocusLostCallback != null)
+            {
+                this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback);
+            }
+
+            if (_keyInputFocusGainedCallback != null)
+            {
+                this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback);
+            }
+
+            // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
+            // Restore current CPtr.
+            swigCPtr = currentCPtr;
+        }
+
         private EventHandler _keyInputFocusGainedEventHandler;
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void KeyInputFocusGainedCallbackType(IntPtr control);
@@ -850,9 +1025,10 @@ namespace Tizen.NUI.BaseComponents
         {
             View view = null;
 
-            if (Parent)
+            if (Parent is View)
             {
-                view = Parent.FindChildById(id);
+                View parentView = Parent as View;
+                view = parentView.FindChildById(id);
             }
 
             if (!view)
@@ -1699,17 +1875,6 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
-        /// <summary>
-        /// Retrieves the view's parent.<br>
-        /// </summary>
-        public View Parent
-        {
-            get
-            {
-                return GetParent();
-            }
-        }
-
         [Obsolete("Please do not use! this will be deprecated. Please use Visibility instead.")]
         public bool Visible
         {
@@ -2055,32 +2220,6 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Adds a child view to this View.
-        /// </summary>
-        /// <pre>This View(the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent view.</pre>
-        /// <post>The child will be referenced by its parent. This means that the child will be kept alive, even if the handle passed into this method is reset or destroyed.</post>
-        /// <remarks>If the child already has a parent, it will be removed from old parent and reparented to this view. This may change child's position, color, scale etc as it now inherits them from this view.</remarks>
-        /// <param name="child">The child</param>
-        public void Add(View child)
-        {
-            NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        /// <summary>
-        /// Removes a child View from this View. If the view was not a child of this view, this is a no-op.
-        /// </summary>
-        /// <pre>This View(the parent) has been initialized. The child view is not the same as the parent view.</pre>
-        /// <param name="child">The child</param>
-        public void Remove(View child)
-        {
-            NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        /// <summary>
         /// Removes a View from its Parent View / Layer. If the View has no parent, this method does nothing.
         /// </summary>
         /// <pre>The (child) View has been initialized. </pre>
@@ -2092,36 +2231,6 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Retrieves the number of children held by the view.
-        /// </summary>
-        /// <pre>The View has been initialized.</pre>
-        /// <returns>The number of children</returns>
-        internal uint GetChildCount()
-        {
-            uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr);
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        /// <summary>
-        /// Retrieves child view by index.
-        /// </summary>
-        /// <pre>The View has been initialized.</pre>
-        /// <param name="index">The index of the child to retrieve</param>
-        /// <returns>The view for the given index or empty handle if children not initialized</returns>
-        public View GetChildAt(uint index)
-        {
-            IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index);
-
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret ?? null;
-        }
-
-        /// <summary>
         /// Search through this view's hierarchy for an view with the given name.
         /// The view itself is also considered in the search.
         /// </summary>
@@ -2150,47 +2259,6 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
-        /*internal View GetParent()
-        {
-            View ret;
-            IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
-
-            BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
-
-            if(basehandle is Layer)
-            {
-                ret = new View(cPtr,false);
-            }
-            else
-            {
-                ret = basehandle as View;
-            }
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }*/
-
-        internal View GetParent()
-        {
-            View ret;
-            IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
-
-            BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
-
-            if(basehandle is Layer)
-            {
-                View ret2 = new View(cPtr,false);
-                return ret2;
-            }
-
-            ret = basehandle as View;
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
         internal void SetParentOrigin(Vector3 origin)
         {
             NDalicPINVOKE.Actor_SetParentOrigin(swigCPtr, Vector3.getCPtr(origin));
@@ -3893,6 +3961,32 @@ namespace Tizen.NUI.BaseComponents
             }
         }
 
+        [Obsolete("Please DO NOT use! This will be deprecated! Please use 'Container GetParent()' instead!")]
+        public View Parent
+        {
+            get
+            {
+                View ret;
+                IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr);
+
+                BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr);
+
+                if (basehandle is Layer)
+                {
+                    ret = new View(cPtr, false);
+                }
+                else
+                {
+                    ret = basehandle as View;
+                }
+
+                if (NDalicPINVOKE.SWIGPendingException.Pending)
+                    throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+                return ret;
+            }
+        }
+
+
 
 
 
index dc36895..d33ce5d 100755 (executable)
@@ -57,7 +57,7 @@ namespace Tizen.NUI.BaseComponents
             CustomViewRegistry.Instance.Register(CreateInstance, typeof(VisualView));
         }
 
-        public VisualView() : base(typeof(VisualView).Name, CustomViewBehaviour.ViewBehaviourDefault)
+        public VisualView() : base(typeof(VisualView).FullName, CustomViewBehaviour.ViewBehaviourDefault)
         {
         }
 
index c692895..40ed2a1 100755 (executable)
@@ -25,12 +25,16 @@ namespace Tizen.NUI
 
         internal BaseHandle(global::System.IntPtr cPtr, bool cMemoryOwn)
         {
+            //to catch derived classes dali native exceptions
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
             _registerMe = swigCMemOwn = cMemoryOwn;
 
             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
 
             // using copy constructor to create another native handle so Registry.Unregister works fine.
             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_BaseHandle__SWIG_2(swigCPtr));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
             if (_registerMe)
             {
@@ -47,6 +51,7 @@ namespace Tizen.NUI
 
             // using copy constructor to create another native handle so Registry.Unregister works fine.
             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_BaseHandle__SWIG_2(swigCPtr));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
             if (_registerMe)
             {
@@ -337,6 +342,14 @@ namespace Tizen.NUI
             return ret;
         }
 
+        internal global::System.Runtime.InteropServices.HandleRef GetBaseHandleCPtrHandleRef
+        {
+            get
+            {
+                return swigCPtr;
+            }
+        }
+
     }
 
 }
diff --git a/src/Tizen.NUI/src/public/Container.cs b/src/Tizen.NUI/src/public/Container.cs
new file mode 100755 (executable)
index 0000000..515874e
--- /dev/null
@@ -0,0 +1,114 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+using System;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    ///
+    /// Container is an abstract class to be inherited from by classes that desire to have Views
+    /// added to them.
+    ///
+    /// </summary>
+
+    public abstract class Container : Animatable
+    {
+
+        internal Container(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+        {
+            // No un-managed data hence no need to store a native ptr
+        }
+
+        protected override void Dispose(DisposeTypes type)
+        {
+            if (disposed)
+            {
+                return;
+            }
+
+            base.Dispose(type);
+        }
+
+
+        /// <summary>
+        /// Adds a child view to this Container.
+        /// </summary>
+        /// <pre>This Container(the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent view.</pre>
+        /// <post>The child will be referenced by its parent. This means that the child will be kept alive, even if the handle passed into this method is reset or destroyed.</post>
+        /// <remarks>If the child already has a parent, it will be removed from old parent and reparented to this view. This may change child's position, color, scale etc as it now inherits them from this view.</remarks>
+        /// <param name="view">The child view to add</param>
+        public abstract void Add( View view );
+
+        /// <summary>
+        /// Removes a child View from this View. If the view was not a child of this view, this is a no-op.
+        /// </summary>
+        /// <pre>This View(the parent) has been initialized. The child view is not the same as the parent view.</pre>
+        /// <param name="child">The child</param>
+        public abstract void Remove( View view );
+
+        /// <summary>
+        /// Retrieves child view by index.
+        /// </summary>
+        /// <pre>The View has been initialized.</pre>
+        /// <param name="index">The index of the child to retrieve</param>
+        /// <returns>The view for the given index or empty handle if children not initialized</returns>
+        public abstract View GetChildAt( uint index );
+
+        /// <summary>
+        /// Get the parent of this container
+        /// </summary>
+        /// <pre>The child container has been initialized.</pre>
+        /// <returns>The parent container</returns>
+        protected abstract Container GetParent();
+
+        /// <summary>
+        /// Get the number of children for this container
+        /// </summary>
+        /// <pre>The container has been initialized.</pre>
+        /// <returns>number of children</returns>
+        protected abstract UInt32 GetChildCount();
+
+        /// <summary>
+        /// Get the parent Container
+        /// Read only
+        /// </summary>
+        /// <pre>The child container has been initialized.</pre>
+        /// <returns>The parent container</returns>
+        public Container Parent
+        {
+            get
+            {
+                return GetParent();
+            }
+        }
+
+        /// <summary>
+        /// Get the number of children for this container
+        /// Read only
+        /// </summary>
+        /// <pre>The container has been initialized.</pre>
+        /// <returns>number of children</returns>
+        public uint ChildCount
+        {
+            get
+            {
+                return GetChildCount();
+            }
+        }
+    }
+} // namespace Tizen.NUI
\ No newline at end of file
index c528820..ac1aaff 100755 (executable)
@@ -65,6 +65,31 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_focusedViewEnterKeyEventCallback2 != null)
+            {
+                FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2);
+            }
+
+            if (_focusedViewEnterKeyEventCallback != null)
+            {
+                FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
+            }
+
+            if (_focusGroupChangedEventCallback != null)
+            {
+                FocusGroupChangedSignal().Disconnect(_focusGroupChangedEventCallback);
+            }
+
+            if (_focusChangedEventCallback != null)
+            {
+                FocusChangedSignal().Disconnect(_focusChangedEventCallback);
+            }
+
+            if (_preFocusChangeCallback != null)
+            {
+                PreFocusChangeSignal().Disconnect(_preFocusChangeCallback);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
@@ -403,7 +428,7 @@ namespace Tizen.NUI
             {
                 _focusedViewEnterKeyEventHandler -= value;
 
-                if (_focusedViewEnterKeyEventCallback == null && FocusedViewEnterKeySignal().Empty() == false)
+                if (_focusedViewEnterKeyEventCallback != null && FocusedViewEnterKeySignal().Empty() == false)
                 {
                     FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback);
                 }
@@ -729,7 +754,7 @@ namespace Tizen.NUI
             {
                 _focusedViewEnterKeyEventHandler2 -= value;
 
-                if (_focusedViewEnterKeyEventCallback2 == null && FocusedViewEnterKeySignal().Empty() == false)
+                if (_focusedViewEnterKeyEventCallback2 != null && FocusedViewEnterKeySignal().Empty() == false)
                 {
                     FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2);
                 }
index 16f5728..946f353 100755 (executable)
@@ -54,7 +54,37 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            if (swigCPtr.Handle != IntPtr.Zero)
+            if (_keyboardTypeChangedEventCallback != null)
+            {
+                KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
+            }
+
+            if (_imfManagerLanguageChangedEventCallback != null)
+            {
+                LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
+            }
+
+            if (_imfManagerResizedEventCallback != null)
+            {
+                ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
+            }
+
+            if (_imfManagerStatusChangedEventCallback != null)
+            {
+                StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
+            }
+
+            if (_imfManagerEventReceivedEventCallback != null)
+            {
+                EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
+            }
+
+            if (_imfManagerActivatedEventCallback != null)
+            {
+                ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
+            }
+
+            if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
                 {
index 17179f8..f4aaa35 100755 (executable)
@@ -22,7 +22,7 @@ namespace Tizen.NUI
     /// <summary>
     /// Layers provide a mechanism for overlaying groups of actors on top of each other.
     /// </summary>
-    public class Layer : Animatable
+    public class Layer : Container
     {
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
 
@@ -36,6 +36,64 @@ namespace Tizen.NUI
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
         }
 
+        /// from Container base class
+
+        /// <summary>
+        /// Adds a child view to this layer.
+        /// </summary>
+        /// <seealso cref="Container::Add()">
+        /// </seealso>
+        public override void Add(View child)
+        {
+            NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Removes a child View from this layer. If the view was not a child of this layer, this is a no-op.
+        /// </summary>
+        /// <seealso cref="Container::Add()">
+        /// </seealso>
+        public override void Remove(View child)
+        {
+            NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Retrieves child view by index.
+        /// </summary>
+        /// <pre>The View has been initialized.</pre>
+        /// <param name="index">The index of the child to retrieve</param>
+        /// <returns>The view for the given index or empty handle if children not initialized</returns>
+        public override View GetChildAt(uint index)
+        {
+            System.IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index);
+
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
+
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+
+            return ret ?? null;
+        }
+
+
+        protected override Container GetParent()
+        {
+            return null;
+        }
+
+        protected override uint GetChildCount()
+        {
+            uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         protected override void Dispose(DisposeTypes type)
         {
             if(disposed)
@@ -126,32 +184,6 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Adds a child view to this layer.
-        /// </summary>
-        /// <pre>This layer(the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent layer.</pre>
-        /// <post>The child will be referenced by its parent. This means that the child will be kept alive, even if the handle passed into this method is reset or destroyed.</post>
-        /// <remarks>If the child already has a parent, it will be removed from old parent and reparented to this layer. This may change child's position, color, scale etc as it now inherits them from this layer.</remarks>
-        /// <param name="child">The child</param>
-        public void Add(View child)
-        {
-            NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        /// <summary>
-        /// Removes a child View from this layer. If the view was not a child of this layer, this is a no-op.
-        /// </summary>
-        /// <pre>This layer(the parent) has been initialized. The child view is not the same as the parent view.</pre>
-        /// <param name="child">The child</param>
-        public void Remove(View child)
-        {
-            NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        /// <summary>
         /// Queries the depth of the layer.<br>
         /// 0 is the bottom most layer, higher number is on top.<br>
         /// </summary>
@@ -286,24 +318,6 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Retrieves child view by index.
-        /// </summary>
-        /// <pre>The View has been initialized.</pre>
-        /// <param name="index">The index of the child to retrieve</param>
-        /// <returns>The view for the given index or empty handle if children not initialized</returns>
-        public View GetChildAt(uint index)
-        {
-            System.IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index);
-
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending)
-                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-
-            return ret ?? null;
-        }
-
-        /// <summary>
         /// Enumeration for the behavior of the layer.
         /// </summary>
         public enum LayerBehavior
@@ -459,5 +473,6 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
+
     }
 }
index 32f9950..77639e8 100755 (executable)
@@ -182,6 +182,16 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Ensures that the function passed in is called from the main loop when it is idle.
+        /// </summary>
+        /// <param name="func">The function to call</param>
+        /// <returns>true if added successfully, false otherwise</returns>
+        public bool AddIdle(System.Delegate func)
+        {
+            return ((NUICoreBackend)this.Backend).AddIdle(func);
+        }
+
+        /// <summary>
         /// Enumeration for deciding whether a NUI application window is opaque or transparent.
         /// </summary>
         public enum WindowMode
diff --git a/src/Tizen.NUI/src/public/NUIWidgetApplication.cs b/src/Tizen.NUI/src/public/NUIWidgetApplication.cs
new file mode 100755 (executable)
index 0000000..c0de24c
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+using System;
+using Tizen.Applications;
+using Tizen.Applications.CoreBackend;
+using Tizen.NUI;
+
+namespace Tizen.NUI
+{
+
+    /// <summary>
+    /// Represents an application that have UI screen. The NUIWidgetApplication class has a default stage.
+    /// </summary>
+    public class NUIWidgetApplication : CoreApplication
+    {
+
+        /// <summary>
+        /// The default constructor.
+        /// </summary>
+        public NUIWidgetApplication() : base(new NUIWidgetCoreBackend())
+        {
+            Tizen.Log.Fatal("NUI", "### NUIWidgetApplication called");
+        }
+
+        /// <summary>
+        /// The constructor with stylesheet.
+        /// </summary>
+        public NUIWidgetApplication(string stylesheet) : base(new NUIWidgetCoreBackend(stylesheet))
+        {
+            Tizen.Log.Fatal("NUI", "### NUIWidgetApplication(string) called");
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior.
+        /// </summary>
+        protected override void OnLocaleChanged(LocaleChangedEventArgs e)
+        {
+            Log.Fatal("NUI", "OnLocaleChanged() is called!");
+            base.OnLocaleChanged(e);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior.
+        /// </summary>
+        protected override void OnLowBattery(LowBatteryEventArgs e)
+        {
+            Log.Fatal("NUI", "OnLowBattery() is called!");
+            base.OnLowBattery(e);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior.
+        /// </summary>
+        protected override void OnLowMemory(LowMemoryEventArgs e)
+        {
+            Log.Fatal("NUI", "OnLowMemory() is called!");
+            base.OnLowMemory(e);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior.
+        /// </summary>
+        protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
+        {
+            Log.Fatal("NUI", "OnRegionFormatChanged() is called!");
+            base.OnRegionFormatChanged(e);
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior.
+        /// </summary>
+        protected override void OnTerminate()
+        {
+            Log.Fatal("NUI", "OnTerminate() is called!");
+            base.OnTerminate();
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior.
+        /// </summary>
+        protected virtual void OnPreCreate()
+        {
+            Log.Fatal("NUI", "OnPreCreate() is called!");
+        }
+
+        /// <summary>
+        /// Overrides this method if want to handle behavior.
+        /// </summary>
+        protected override void OnCreate()
+        {
+            // This is also required to create DisposeQueue on main thread.
+            DisposeQueue disposeQ = DisposeQueue.Instance;
+            disposeQ.Initialize();
+            Log.Fatal("NUI","OnCreate() is called!");
+            base.OnCreate();
+        }
+
+        /// <summary>
+        /// Run NUIWidgetApplication.
+        /// </summary>
+        /// <param name="args">Arguments from commandline.</param>
+        public override void Run(string[] args)
+        {
+            Backend.AddEventHandler(EventType.PreCreated, OnPreCreate);
+            base.Run(args);
+        }
+
+        /// <summary>
+        /// Exit NUIWidgetApplication.
+        /// </summary>
+        public override void Exit()
+        {
+            Tizen.Log.Fatal("NUI", "### NUIWidgetApplication Exit called");
+            base.Exit();
+        }
+
+        internal WidgetApplication ApplicationHandle
+        {
+            get
+            {
+                return ((NUIWidgetCoreBackend)this.Backend).WidgetApplicationHandle;
+            }
+        }
+
+        /// <summary>
+        /// Get the window instance.
+        /// </summary>
+        public Window Window
+        {
+            get
+            {
+                //return Window.Instance;
+                return ApplicationHandle.GetWindow();
+            }
+        }
+    }
+}
index 960b5f4..d579034 100755 (executable)
@@ -63,6 +63,11 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_styleManagerStyleChangedCallbackDelegate != null)
+            {
+                StyleChangedSignal().Disconnect(_styleManagerStyleChangedCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index ec2b788..415606b 100755 (executable)
@@ -54,6 +54,11 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_stateChangedEventCallback != null)
+            {
+                StateChangedSignal().Disconnect(_stateChangedEventCallback);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index 41c9b7a..f873d6e 100755 (executable)
@@ -62,6 +62,11 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_timerTickCallbackDelegate != null)
+            {
+                TickSignal().Disconnect(_timerTickCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index a67858d..43eb91a 100755 (executable)
@@ -72,6 +72,8 @@ namespace Tizen.NUI.UIComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            DisConnectFromSignals();
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
@@ -85,6 +87,39 @@ namespace Tizen.NUI.UIComponents
             base.Dispose(type);
         }
 
+        private void DisConnectFromSignals()
+        {
+            // Save current CPtr.
+            global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr;
+
+            // Use BaseHandle CPtr as current might have been deleted already in derived classes.
+            swigCPtr = GetBaseHandleCPtrHandleRef;
+
+            if (_stateChangedCallback != null)
+            {
+                StateChangedSignal().Disconnect(_stateChangedCallback);
+            }
+
+            if (_releasedCallback != null)
+            {
+                ReleasedSignal().Disconnect(_releasedCallback);
+            }
+
+            if (_pressedCallback != null)
+            {
+                this.PressedSignal().Disconnect(_pressedCallback);
+            }
+
+            if (_clickedCallback != null)
+            {
+                ClickedSignal().Disconnect(_clickedCallback);
+            }
+
+            // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here.
+            // Restore current CPtr.
+            swigCPtr = currentCPtr;
+        }
+
 
         private EventHandlerWithReturnType<object, EventArgs, bool> _clickedEventHandler;
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
index 24a606d..a39f012 100755 (executable)
@@ -58,6 +58,31 @@ namespace Tizen.NUI.UIComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_popUpHiddenEventCallbackDelegate != null)
+            {
+                HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate);
+            }
+
+            if (_popUpHidingEventCallbackDelegate != null)
+            {
+                HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate);
+            }
+
+            if (_popUpShownEventCallbackDelegate != null)
+            {
+                ShownSignal().Disconnect(_popUpShownEventCallbackDelegate);
+            }
+
+            if (_popUpShowingEventCallbackDelegate != null)
+            {
+                ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate);
+            }
+
+            if (_popUpOutsideTouchedEventCallbackDelegate != null)
+            {
+                this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index 978e777..a6bde47 100755 (executable)
@@ -60,6 +60,11 @@ namespace Tizen.NUI.UIComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_progressBarValueChangedCallbackDelegate != null)
+            {
+                ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index 51417f2..9a9a5ad 100755 (executable)
@@ -60,6 +60,16 @@ namespace Tizen.NUI.UIComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
+            {
+                ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
+            }
+
+            if (_scrollBarPanFinishedEventCallbackDelegate != null)
+            {
+                PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index b9bb7ea..67f307f 100755 (executable)
@@ -54,6 +54,11 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_scrollViewSnapStartedCallbackDelegate != null)
+            {
+                this.SnapStartedSignal().Disconnect(_scrollViewSnapStartedCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index a7d6882..3bb0e12 100755 (executable)
@@ -60,6 +60,21 @@ namespace Tizen.NUI.UIComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_sliderValueChangedCallbackDelegate != null)
+            {
+                ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate);
+            }
+
+            if (_sliderSlidingFinishedCallbackDelegate != null)
+            {
+                SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate);
+            }
+
+            if (_sliderMarkReachedCallbackDelegate != null)
+            {
+                MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
index 01098c3..1c0584d 100755 (executable)
@@ -74,7 +74,7 @@ namespace Tizen.NUI
                 _visualSize = value;
                 if (_visualSizePolicy == null)
                 {
-                    _visualSizePolicy = new Vector2(0.0f, 0.0f);
+                    _visualSizePolicy = new Vector2(1.0f, 1.0f);
                 }
                 UpdateVisual();
             }
@@ -97,7 +97,7 @@ namespace Tizen.NUI
                 _visualOffset = value;
                 if (_visualOffsetPolicy == null)
                 {
-                    _visualOffsetPolicy = new Vector2(0.0f, 0.0f);
+                    _visualOffsetPolicy = new Vector2(1.0f, 1.0f);
                 }
                 UpdateVisual();
             }
diff --git a/src/Tizen.NUI/src/public/Widget.cs b/src/Tizen.NUI/src/public/Widget.cs
new file mode 100755 (executable)
index 0000000..098e5ab
--- /dev/null
@@ -0,0 +1,620 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+using System;
+using System.Runtime.InteropServices;
+using Tizen.Applications;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// Widget object should be created by WidgetApplication.
+    /// </summary>
+    public class Widget : BaseHandle
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+
+        internal Widget(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.Widget_SWIGUpcast(cPtr), cMemoryOwn)
+        {
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Widget obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        /// <summary>
+        /// To make Widget instance be disposed.
+        /// </summary>
+        protected override void Dispose(DisposeTypes type)
+        {
+            if(disposed)
+            {
+                return;
+            }
+
+            if(type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+            }
+
+            //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 (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                if (swigCMemOwn)
+                {
+                    swigCMemOwn = false;
+                    NDalicManualPINVOKE.delete_Widget(swigCPtr);
+                }
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            base.Dispose(type);
+        }
+
+        /// <summary>
+        /// This is the constructor for Widget.
+        /// </summary>
+        /// <param name="id">for widget instance</param>
+        public Widget(string id) : this(NDalicManualPINVOKE.Widget_New(id), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal Widget(Widget widget) : this(NDalicManualPINVOKE.new_Widget__SWIG_1(Widget.getCPtr(widget)), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal Widget Assign(Widget widget)
+        {
+            Widget ret = new Widget(NDalicManualPINVOKE.Widget_Assign(swigCPtr, Widget.getCPtr(widget)), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Event arguments that passed via KeyEvent signal.
+        /// </summary>
+        public class CreateEventArgs : EventArgs
+        {
+            /// <summary>
+            /// widget data.
+            /// </summary>
+            public WidgetData WidgetData
+            {
+                get;
+                set;
+            }
+
+            /// <summary>
+            /// a bundle.
+            /// </summary>
+            public SWIGTYPE_p_bundle Bundle
+            {
+                get;
+                set;
+            }
+
+            /// <summary>
+            /// window size.
+            /// </summary>
+            public Size2D WindowSize
+            {
+                get;
+                set;
+            }
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void CreateCallbackType(IntPtr widgetData, IntPtr bundle, IntPtr windowSize);
+        private CreateCallbackType _createCallback;
+        private EventHandler<CreateEventArgs> _createEventHandler;
+
+        /// <summary>
+        /// Create event.
+        /// </summary>
+        public event EventHandler<CreateEventArgs> Create
+        {
+            add
+            {
+                if (_createEventHandler == null)
+                {
+                    _createCallback = OnCreate;
+                    CreateSignal().Connect(_createCallback);
+                }
+
+                _createEventHandler += value;
+            }
+
+            remove
+            {
+                _createEventHandler -= value;
+
+                if (_createEventHandler == null && CreateSignal().Empty() == false)
+                {
+                   CreateSignal().Disconnect(_createCallback);
+                }
+            }
+        }
+
+        private void OnCreate(IntPtr widgetData, IntPtr bundle, IntPtr windowSize)
+        {
+            CreateEventArgs e = new CreateEventArgs();
+            if (widgetData != null)
+            {
+                e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData);
+            }
+            if (bundle != null)
+            {
+                e.Bundle = new SWIGTYPE_p_bundle(bundle, false);
+            }
+            if (windowSize != null)
+            {
+                var val = new Uint16Pair(windowSize, false);
+                e.WindowSize = val;
+                val.Dispose();
+            }
+
+            _createEventHandler?.Invoke(this, e);
+        }
+
+        internal WidgetInstanceCreateSignalType CreateSignal()
+        {
+            WidgetInstanceCreateSignalType ret = new WidgetInstanceCreateSignalType(NDalicManualPINVOKE.Widget_CreateSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Event arguments that passed via terminate event signal.
+        /// </summary>
+        public class TerminateEventArgs : EventArgs
+        {
+            /// <summary>
+            /// widget data.
+            /// </summary>
+            public WidgetData WidgetData
+            {
+                get;
+                set;
+            }
+
+            /// <summary>
+            /// a bundle.
+            /// </summary>
+            public SWIGTYPE_p_bundle Bundle
+            {
+                get;
+                set;
+            }
+
+            /// <summary>
+            /// widget terminate type.
+            /// </summary>
+            public WidgetTerminateType WidgetTerminateType
+            {
+                get;
+                set;
+            }
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void TerminateCallbackType(IntPtr widgetData, IntPtr bundle, WidgetTerminateType widgetTerminateType);
+        private TerminateCallbackType _terminateCallback;
+        private EventHandler<TerminateEventArgs> _terminateEventHandler;
+
+        /// <summary>
+        /// Terminate event.
+        /// </summary>
+        public event EventHandler<TerminateEventArgs> Terminate
+        {
+            add
+            {
+                if (_terminateEventHandler == null)
+                {
+                    _terminateCallback = OnTerminate;
+                    TerminateSignal().Connect(_terminateCallback);
+                }
+
+                _terminateEventHandler += value;
+            }
+
+            remove
+            {
+                _terminateEventHandler -= value;
+
+                if (_terminateEventHandler == null && TerminateSignal().Empty() == false)
+                {
+                   TerminateSignal().Disconnect(_terminateCallback);
+                }
+            }
+        }
+
+        private void OnTerminate(IntPtr widgetData, IntPtr bundle, WidgetTerminateType widgetTerminateType)
+        {
+            TerminateEventArgs e = new TerminateEventArgs();
+            if (widgetData != null)
+            {
+                e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData);
+            }
+            if (bundle != null)
+            {
+                e.Bundle = new SWIGTYPE_p_bundle(bundle, false);
+            }
+
+            e.WidgetTerminateType = widgetTerminateType;
+            _terminateEventHandler?.Invoke(this, e);
+        }
+
+        internal WidgetInstanceTerminateSignalType TerminateSignal()
+        {
+            WidgetInstanceTerminateSignalType ret = new WidgetInstanceTerminateSignalType(NDalicManualPINVOKE.Widget_TerminateSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Event arguments that passed via pause event signal.
+        /// </summary>
+        public class PauseEventArgs : EventArgs
+        {
+            /// <summary>
+            /// widget data.
+            /// </summary>
+            public WidgetData WidgetData
+            {
+                get;
+                set;
+            }
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void PauseCallbackType(IntPtr widgetData);
+        private PauseCallbackType _pauseCallback;
+        private EventHandler<PauseEventArgs> _pauseEventHandler;
+
+        /// <summary>
+        /// Pause event.
+        /// </summary>
+        public event EventHandler<PauseEventArgs> Pause
+        {
+            add
+            {
+                if (_pauseEventHandler == null)
+                {
+                    _pauseCallback = OnPause;
+                    PauseSignal().Connect(_pauseCallback);
+                }
+
+                _pauseEventHandler += value;
+            }
+
+            remove
+            {
+                _pauseEventHandler -= value;
+
+                if (_pauseEventHandler == null && PauseSignal().Empty() == false)
+                {
+                   PauseSignal().Disconnect(_pauseCallback);
+                }
+            }
+        }
+
+        private void OnPause(IntPtr widgetData)
+        {
+            PauseEventArgs e = new PauseEventArgs();
+            if (widgetData != null)
+            {
+                e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData);
+            }
+
+            _pauseEventHandler?.Invoke(this, e);
+        }
+
+        internal WidgetInstancePauseOrResumeSignalType PauseSignal()
+        {
+            WidgetInstancePauseOrResumeSignalType ret = new WidgetInstancePauseOrResumeSignalType(NDalicManualPINVOKE.Widget_PauseSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Event arguments that passed via pause event signal.
+        /// </summary>
+        public class ResumeEventArgs : EventArgs
+        {
+            /// <summary>
+            /// widget data.
+            /// </summary>
+            public WidgetData WidgetData
+            {
+                get;
+                set;
+            }
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void ResumeCallbackType(IntPtr widgetData);
+        private ResumeCallbackType _resumeCallback;
+        private EventHandler<ResumeEventArgs> _resumeEventHandler;
+
+        /// <summary>
+        /// Resume event.
+        /// </summary>
+        public event EventHandler<ResumeEventArgs> Resume
+        {
+            add
+            {
+                if (_resumeEventHandler == null)
+                {
+                    _resumeCallback = OnResume;
+                    ResumeSignal().Connect(_resumeCallback);
+                }
+
+                _resumeEventHandler += value;
+            }
+
+            remove
+            {
+                _resumeEventHandler -= value;
+
+                if (_resumeEventHandler == null && ResumeSignal().Empty() == false)
+                {
+                   ResumeSignal().Disconnect(_resumeCallback);
+                }
+            }
+        }
+
+        private void OnResume(IntPtr widgetData)
+        {
+            ResumeEventArgs e = new ResumeEventArgs();
+            if (widgetData != null)
+            {
+                e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData);
+            }
+
+            _resumeEventHandler?.Invoke(this, e);
+        }
+
+        internal WidgetInstancePauseOrResumeSignalType ResumeSignal()
+        {
+            WidgetInstancePauseOrResumeSignalType ret = new WidgetInstancePauseOrResumeSignalType(NDalicManualPINVOKE.Widget_ResumeSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Event arguments that passed via resize signal.
+        /// </summary>
+        public class ResizeEventArgs : EventArgs
+        {
+            /// <summary>
+            /// widget data.
+            /// </summary>
+            public WidgetData WidgetData
+            {
+                get;
+                set;
+            }
+
+            /// <summary>
+            /// window size.
+            /// </summary>
+            public Size2D WindowSize
+            {
+                get;
+                set;
+            }
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void ResizeCallbackType(IntPtr widgetData, IntPtr windowSize);
+        private ResizeCallbackType _resizeCallback;
+        private EventHandler<ResizeEventArgs> _resizeEventHandler;
+
+        /// <summary>
+        /// Resize event.
+        /// </summary>
+        public event EventHandler<ResizeEventArgs> Resize
+        {
+            add
+            {
+                if (_resizeEventHandler == null)
+                {
+                    _resizeCallback = OnResize;
+                    ResizeSignal().Connect(_resizeCallback);
+                }
+
+                _resizeEventHandler += value;
+            }
+
+            remove
+            {
+                _resizeEventHandler -= value;
+
+                if (_resizeEventHandler == null && ResizeSignal().Empty() == false)
+                {
+                   ResizeSignal().Disconnect(_resizeCallback);
+                }
+            }
+        }
+
+        private void OnResize(IntPtr widgetData, IntPtr windowSize)
+        {
+            ResizeEventArgs e = new ResizeEventArgs();
+            if (widgetData != null)
+            {
+                e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData);
+            }
+            if (windowSize != null)
+            {
+                var val = new Uint16Pair(windowSize, false);
+                e.WindowSize = val;
+                val.Dispose();
+            }
+
+            _resizeEventHandler?.Invoke(this, e);
+        }
+
+        internal WidgetInstanceResizeSignalType ResizeSignal()
+        {
+            WidgetInstanceResizeSignalType ret = new WidgetInstanceResizeSignalType(NDalicManualPINVOKE.Widget_ResizeSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Event arguments that passed via update event signal.
+        /// </summary>
+        public class UpdateEventArgs : EventArgs
+        {
+            /// <summary>
+            /// widget data.
+            /// </summary>
+            public WidgetData WidgetData
+            {
+                get;
+                set;
+            }
+
+            /// <summary>
+            /// A bundle.
+            /// </summary>
+            public SWIGTYPE_p_bundle Bundle
+            {
+                get;
+                set;
+            }
+
+            /// <summary>
+            /// It means several steps.
+            /// </summary>
+            /// <remark>
+            /// 0 -> no force
+            /// 1 -> force but do someting
+            /// 2 -> force
+            /// </remark>
+            public int Force
+            {
+                get;
+                set;
+            }
+        }
+
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        private delegate void UpdateCallbackType(IntPtr widgetData, IntPtr bundle, int force);
+        private UpdateCallbackType _updateCallback;
+        private EventHandler<UpdateEventArgs> _updateEventHandler;
+
+        /// <summary>
+        /// Update event.
+        /// </summary>
+        public event EventHandler<UpdateEventArgs> Update
+        {
+            add
+            {
+                if (_updateEventHandler == null)
+                {
+                    _updateCallback = OnUpdate;
+                    UpdateSignal().Connect(_updateCallback);
+                }
+
+                _updateEventHandler += value;
+            }
+
+            remove
+            {
+                _updateEventHandler -= value;
+
+                if (_updateEventHandler == null && UpdateSignal().Empty() == false)
+                {
+                   UpdateSignal().Disconnect(_updateCallback);
+                }
+            }
+        }
+
+        private void OnUpdate(IntPtr widgetData, IntPtr bundle, int force)
+        {
+            UpdateEventArgs e = new UpdateEventArgs();
+            if (widgetData != null)
+            {
+                e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData);
+            }
+            if (bundle != null)
+            {
+                e.Bundle = new SWIGTYPE_p_bundle(bundle, false);
+            }
+            e.Force = force;
+
+            _updateEventHandler?.Invoke(this, e);
+        }
+
+        internal WidgetInstanceUpdateSignalType UpdateSignal()
+        {
+            WidgetInstanceUpdateSignalType ret = new WidgetInstanceUpdateSignalType(NDalicManualPINVOKE.Widget_UpdateSignal(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Enumeration for terminate type of widget instance.
+        /// </summary>
+        public enum WidgetTerminateType
+        {
+            /// <summary>
+            /// User deleted this widget from the viewer
+            /// </summary>
+            Permanent,
+            /// <summary>
+            /// Widget is deleted because of other reasons (e.g. widget process is terminated temporarily by the system)
+            /// </summary>
+            Temporary
+        }
+
+        /// <summary>
+        /// Enumeration for lifecycle event type of widget instance.
+        /// </summary>
+        public enum WidgetLifecycleEventType
+        {
+            /// <summary>
+            /// The widget is dead.
+            /// </summary>
+            AppDead = 0,
+            /// <summary>
+            /// The widget is dead.
+            /// </summary>
+            Create = 1,
+            /// <summary>
+            /// The widget is destroyed.
+            /// </summary>
+            Destroy = 2,
+            /// <summary>
+            /// The widget is paused.
+            /// </summary>
+            Pause = 3,
+            /// <summary>
+            /// The widget is resumed.
+            /// </summary>
+            Resume = 4
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/public/WidgetData.cs b/src/Tizen.NUI/src/public/WidgetData.cs
new file mode 100755 (executable)
index 0000000..7053846
--- /dev/null
@@ -0,0 +1,161 @@
+/** Copyright (c) 2017 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// Widget data.
+    /// </summary>
+    public class WidgetData : BaseHandle
+    {
+        private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+
+        internal WidgetData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetData_SWIGUpcast(cPtr), cMemoryOwn)
+        {
+            swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+        }
+
+        internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetData obj)
+        {
+            return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+        }
+
+        /// <summary>
+        /// To make Window instance be disposed.
+        /// </summary>
+        protected override void Dispose(DisposeTypes type)
+        {
+            if(disposed)
+            {
+                return;
+            }
+
+            if(type == DisposeTypes.Explicit)
+            {
+                //Called by User
+                //Release your own managed resources here.
+                //You should release all of your own disposable objects here.
+            }
+
+            //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 (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                if (swigCMemOwn)
+                {
+                    swigCMemOwn = false;
+                    NDalicManualPINVOKE.delete_WidgetData(swigCPtr);
+                }
+                swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+            }
+
+            base.Dispose(type);
+        }
+
+        internal static WidgetData GetWidgetDataFromPtr(global::System.IntPtr cPtr)
+        {
+            WidgetData ret = new WidgetData(cPtr, false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        internal WidgetData(string instanceId, SWIGTYPE_p_bundle args, string content) : this(NDalicManualPINVOKE.WidgetData_New(instanceId, SWIGTYPE_p_bundle.getCPtr(args), content), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal WidgetData(WidgetData widgetData) : this(NDalicManualPINVOKE.new_WidgetData__SWIG_1(WidgetData.getCPtr(widgetData)), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        internal WidgetData Assign(WidgetData widgetData)
+        {
+            WidgetData ret = new WidgetData(NDalicManualPINVOKE.WidgetData_Assign(swigCPtr, WidgetData.getCPtr(widgetData)), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Get widget instance id.
+        /// </summary>
+        /// <returns>Id of widget instance.</returns>
+        public string GetInstanceId()
+        {
+            string ret = NDalicManualPINVOKE.WidgetData_GetInstanceId(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        internal SWIGTYPE_p_bundle GetArgs()
+        {
+            global::System.IntPtr cPtr = NDalicManualPINVOKE.WidgetData_GetArgs(swigCPtr);
+            SWIGTYPE_p_bundle ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_bundle(cPtr, false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Get widget instance content.
+        /// </summary>
+        /// <returns>Content of widget instance.</returns>
+        public string GetContent()
+        {
+            string ret = NDalicManualPINVOKE.WidgetData_GetContent(swigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        /// <summary>
+        /// Get widget instance Window.
+        /// </summary>
+        /// <returns>Window of widget instance</returns>
+        public Window GetWindow()
+        {
+            Window ret = new Window(NDalicManualPINVOKE.WidgetData_GetWindow(swigCPtr), false);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
+        internal void SetArgs(SWIGTYPE_p_bundle args)
+        {
+            NDalicManualPINVOKE.WidgetData_SetArgs(swigCPtr, SWIGTYPE_p_bundle.getCPtr(args));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Set widget instance arguments.
+        /// </summary>
+        /// <param name="content">Content of widget instance</param>
+        public void SetContent(string content)
+        {
+            NDalicManualPINVOKE.WidgetData_SetContent(swigCPtr, content);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Set widget instance arguments.
+        /// </summary>
+        /// <param name="window">Window of widget instance.</param>
+        public void SetWindow(Window window)
+        {
+            NDalicManualPINVOKE.WidgetData_SetWindow(swigCPtr, Window.getCPtr(window));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+    }
+}
index 8c2b91f..e904b4a 100755 (executable)
@@ -30,6 +30,7 @@ namespace Tizen.NUI
         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
         private global::System.Runtime.InteropServices.HandleRef stageCPtr;
         private Layer _rootLayer;
+        private string _windowTitle;
 
         internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
         {
@@ -66,6 +67,56 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
+            if (_windowFocusChangedEventCallback != null)
+            {
+                WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
+            }
+
+            if (_stageTouchCallbackDelegate != null)
+            {
+                TouchSignal().Disconnect(_stageTouchCallbackDelegate);
+            }
+
+            if (_stageWheelCallbackDelegate != null)
+            {
+                WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
+            }
+
+            if (_stageKeyCallbackDelegate != null)
+            {
+                KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
+            }
+
+            if (_stageEventProcessingFinishedEventCallbackDelegate != null)
+            {
+                EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
+            }
+
+            if (_stageContextLostEventCallbackDelegate != null)
+            {
+                ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
+            }
+
+            if (_stageContextRegainedEventCallbackDelegate != null)
+            {
+                this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
+            }
+
+            if (_stageSceneCreatedEventCallbackDelegate != null)
+            {
+                SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
+            }
+
+            if (_windowResizedEventCallback != null)
+            {
+                ResizedSignal().Disconnect(_windowResizedEventCallback);
+            }
+
+            if (_windowFocusChangedEventCallback2 != null)
+            {
+                WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2);
+            }
+
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
                 if (swigCMemOwn)
@@ -379,6 +430,22 @@ namespace Tizen.NUI
             }
         }
 
+        /// <summary>
+        /// Gets/Sets a window title.
+        /// </summary>
+        public string Title
+        {
+            get
+            {
+                return _windowTitle;
+            }
+            set
+            {
+                _windowTitle = value;
+                SetClass( _windowTitle, "" );
+            }
+        }
+
         internal WindowFocusSignalType WindowFocusChangedSignal()
         {
             WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
@@ -424,7 +491,12 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal void SetClass(string name, string klass)
+        /// <summary>
+        /// Sets the window name and class string.
+        /// </summary>
+        /// <param name="name">The name of the window</param>
+        /// <param name="klass">The class of the window</param>
+        public void SetClass(string name, string klass)
         {
             NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
@@ -767,7 +839,7 @@ namespace Tizen.NUI
             return ret;
         }
 
-        internal System.IntPtr GetNativeWindowHandler()
+        public System.IntPtr GetNativeWindowHandler()
         {
             System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
@@ -1414,6 +1486,11 @@ namespace Tizen.NUI
             }
         }
 
+        public static void FeedKeyEvent(Key keyEvent)
+        {
+            NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
 
     }
 }
old mode 100755 (executable)
new mode 100644 (file)
index 03602e2..238d76e
@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
-VisualStudioVersion = 15.0.26430.12
+VisualStudioVersion = 15.0.26430.13
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Pims.Contacts", "Tizen.Pims.Contacts.csproj", "{5B40ACBE-A9D5-492B-AB98-11DD8581941E}"
 EndProject
index c1a4043..4be2929 100644 (file)
@@ -33,7 +33,7 @@ namespace Tizen.Pims.Contacts
         private Object thisLock = new Object();
         private Interop.Database.ContactsDBStatusChangedCallback _contactsDBStatusChangedCallback;
         private EventHandler<DBStatusChangedEventArgs> _dbStatusChanged;
-        private Dictionary<string, EventHandler<DBChangedEventArgs>> _delegateMap = new Dictionary<string, EventHandler<DBChangedEventArgs>>();
+        private Dictionary<string, EventHandler<DBChangedEventArgs>> _eventHandlerMap = new Dictionary<string, EventHandler<DBChangedEventArgs>>();
         private Dictionary<string, Interop.Database.ContactsDBChangedCallback> _callbackMap = new Dictionary<string, Interop.Database.ContactsDBChangedCallback>();
         private Interop.Database.ContactsDBChangedCallback _dbChangedDelegate;
 
@@ -709,48 +709,56 @@ namespace Tizen.Pims.Contacts
         }
 
         /// <summary>
-        /// Registers a callback function to be invoked when a record changes.
+        /// Registers a EventHandler to be invoked when a record changes.
         /// </summary>
         /// <param name="viewUri">The view URI of records whose changes are monitored</param>
         /// <param name="DBChanged">The EventHandler to register</param>
         [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
-        public void AddDBChangedDelegate(string viewUri, EventHandler<DBChangedEventArgs> DBChanged)
+        public void AddDBChangedEventHandler(string viewUri, EventHandler<DBChangedEventArgs> DBChanged)
         {
-            if (_callbackMap[viewUri] == null)
+            if (!_callbackMap.ContainsKey(viewUri))
             {
                 _callbackMap[viewUri] = (string uri, IntPtr userData) =>
                 {
                     DBChangedEventArgs args = new DBChangedEventArgs(uri);
-                    _delegateMap[uri]?.Invoke(this, args);
+                    _eventHandlerMap[uri]?.Invoke(this, args);
                 };
 
                 int error = Interop.Database.AddChangedCb(viewUri, _callbackMap[viewUri], IntPtr.Zero);
                 if ((int)ContactsError.None != error)
                 {
-                    Log.Error(Globals.LogTag, "AddDBChangedDelegate Failed with error " + error);
+                    Log.Error(Globals.LogTag, "AddDBChangedEventHandler Failed with error " + error);
                     throw ContactsErrorFactory.CheckAndCreateException(error);
                 }
             }
 
-            _delegateMap[viewUri] += DBChanged;
+            EventHandler<DBChangedEventArgs> handler = null;
+            if (!_eventHandlerMap.TryGetValue(viewUri, out handler))  
+                _eventHandlerMap.Add(viewUri, null);
+
+            _eventHandlerMap[viewUri] = handler + DBChanged;
         }
 
         /// <summary>
-        /// Deregisters a callback function.
+        /// Deregisters a EventHandler.
         /// </summary>
         /// <param name="viewUri">The view URI of records whose changes are monitored</param>
         /// <param name="DBChanged">The EventHandler to deregister</param>
         [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
-        public void RemoveDBChangedDelegate(string viewUri, EventHandler<DBChangedEventArgs> DBChanged)
+        public void RemoveDBChangedEventHandler(string viewUri, EventHandler<DBChangedEventArgs> DBChanged)
         {
-            _delegateMap[viewUri] -= DBChanged;
+            EventHandler<DBChangedEventArgs> handler = null;
+            if (!_eventHandlerMap.TryGetValue(viewUri, out handler))
+                _eventHandlerMap.Add(viewUri, null);
+            else
+                _eventHandlerMap[viewUri] = handler - DBChanged;
 
-            if (_delegateMap[viewUri] == null)
+            if (_eventHandlerMap[viewUri] == null)
             {
                 int error = Interop.Database.RemoveChangedCb(viewUri, _callbackMap[viewUri], IntPtr.Zero);
                 if ((int)ContactsError.None != error)
                 {
-                    Log.Error(Globals.LogTag, "RemoveDBChangedDelegate Failed with error " + error);
+                    Log.Error(Globals.LogTag, "RemoveDBChangedEventHandler Failed with error " + error);
                     throw ContactsErrorFactory.CheckAndCreateException(error);
                 }
                 _callbackMap.Remove(viewUri);